1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Helen [10]
3 years ago
12

I am confused in Java!

Computers and Technology
1 answer:
GarryVolchara [31]3 years ago
3 0
Import java.util.Random;

class Building
{
    private int w, h;
    private int numberOfWins;

    public Building(int width, int height)
    {
        w = width;
        h = height;

        // generating random windows. can be between 1 and 10
        Random rand = new Random();
        numberOfWins = rand.nextInt(9) + 1;
    }

    public int getWidth() { return w; }
    public int getHeight() { return h; }
    public int numberOfWindows() { return numberOfWins; }

    public String toString()
    {
         return "a black building, width: " + width + ", height: " + height +
                    ", has " + numberOfWins + " windows"; 
    }
}

----------------------------------------------------

then you can create some Building objects and output them!
You might be interested in
Using a tag, set the color to orange for all tags
photoshop1234 [79]

Answer:

ok

Explanation:

5 0
3 years ago
Read 2 more answers
Phân tích cạnh tranh của cocacola và pepsi
Fittoniya [83]
I don’t understand please speak English
7 0
2 years ago
Help please, on tuesday we have oral presentation in zoom and i am afraid to speak in front of people, and i don't know what to
Lapatulllka [165]

Answer:

You should be strong, and be sure about what you want to say. Make sure when you speak it is clear, and makes sense.

Explanation:

If you don't speak up or sound like you know what you are talking about. I like to think of it as dancing. Act like you own the stage, or in your case, like you own the presentation. Also, I suggest you speak to your teacher in private, about him ignoring you. If I were you, I would look for newer friends. Ones that won't ignore you.

6 0
3 years ago
Which building-block feature is available in the Text grouping on the Insert tab?
saveliy_v [14]

Answer:

Business information

Explanation:

The building blocks are durable objects for content like corporate material, headings, timetables, and gallery advertising. The user can retrieve and utilize the building blocks at any time. The user can also design, saves, categorize and enter a description of their own building blocks, and tag them with keywords to help them find easily. 

Business information is one of the main features of the building block galleries that is found on the insert tab in text group.

3 0
3 years ago
Your ipad has an application that will not stop running. what feature/tool can you use to stop it? kill treason task manager for
saveliy_v [14]

you could force quit

6 0
3 years ago
Read 2 more answers
Other questions:
  • I need help please?!!!
    15·1 answer
  • You want to deploy software using group policy. what is necessary before deciding to assign the software to your user accounts?
    11·1 answer
  • Which strategy are you using when you only read the title, section headings, and captions?
    12·2 answers
  • If a user wants to change one small section of the formatting of a document and leave the rest the same, which process should be
    14·1 answer
  • An ethernet switch has a ____ table which is updated by ______.
    14·1 answer
  • 25 Points Discuss games you have played that have poor game design puzzles and how you might improve them.
    10·1 answer
  • You are having problems on your Windows 7 computer and you pull up Device Manager to see if there are any alerts. Two of your de
    11·1 answer
  • Write a program that asks the user for two file names. The first file will be opened for input and the second file will be opene
    8·1 answer
  • Are computer virus and human virus the same​
    6·1 answer
  • You have created a new dhcp scope with address range 192.168.1.1 to 192.168.1.254. you have five servers configured with static
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!