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]
2 years ago
12

I am confused in Java!

Computers and Technology
1 answer:
GarryVolchara [31]2 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
CC stand for.....in the email platform?
Elena L [17]
CC stands for Carbon Copy in emails.
6 0
3 years ago
Read 2 more answers
What does the shell of an operating system do
Andre45 [30]

The OS shell allows access to the operating system services

8 0
2 years ago
Drag each tile to the correct box.
garri49 [273]
I think select the video insert select the movie option under illustrations resize the video player then select the insert tab i’m not 100 percent sure tho
8 0
3 years ago
Read 2 more answers
Is an applications program is a program designed to perform a specific task for specific users
Vika [28.1K]

Answer:

application software or tailored software

6 0
3 years ago
An attribute that can have more than one value for each entity instance is referred to as:
ss7ja [257]

Answer:

D) a multivalued attribute

Explanation:

A multivalued attribute  can have more than one value associated with the entity key.

6 0
3 years ago
Other questions:
  • Which innovation allowed for the mass production of goods? A. Cotton gin B. Sewing machine C. Industrial lubricator D. Interchan
    6·1 answer
  • Jeremy, a college student, is preparing to give a speech on "Social Responsibilities." He refers to a Web page on a tab using
    10·1 answer
  • Despite its vivid design, the website for Lolly's Bookstore did not seem to attract customers who lingered. In fact, most websit
    13·1 answer
  • When a person buys something from an app store, the cost of the item is charged to a credit card whose number often is known by
    5·1 answer
  • Write an assembly language program with a loop and indexed addressing that calculates the sum of all the gaps between successive
    11·1 answer
  • . Write a swift programming code to perform following tasks a) Declare a variable that stores the age of a person b) Declare a c
    5·1 answer
  • _____________________________________________________is a pre-designed format to help users with the creation of a document, lik
    6·1 answer
  • The owner of a candle shop has asked for your help. The shop sells three types of candles as shown below:
    14·1 answer
  • Write the two features of a mouse.​
    9·1 answer
  • My computer is being weird, Everytime I begin to type something on here it keeps adding a letter to the beginning of my sentence
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!