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
kirill115 [55]
3 years ago
13

All windows on the desktop have width and height (as well as numerous other attributes). However the actual contents of the wind

ow change both in structure and appearance depending upon what sort of window is displayed (e.g. a word processing window will display text, a color chooser window display a pallette of colors, a file chooser window displays a directory tree, etc). Thus, the details of the method to actual fill the contents of the window must be deferred to the subclasses of the Window class Write the definition of an abstract class, Window, containing the following: two integer instance variables, width and height, two accessor methods, getWidth and getHeight, a constructor that accepts two integers and uses them to initialize the two instance variables (the parameters should be width followed by height), and an abstract void-returning method named paint that accepts no parameters.
Computers and Technology
1 answer:
Cerrena [4.2K]3 years ago
6 0

Answer:

The abstract class Window:

public abstract class Window

Two integer instance variables, width and height:

private int width, height;

Two accessor methods, getWidth and getHeight:

public int getWidth()

public int getHeight()

A constructor that accepts two integers and uses them to initialize the two instance variables:

public Window(int var1, int var2) {width =var1; height = var2;}

An abstract void-returning method named paint that accepts no parameters

public abstract void paint();

Explanation:

Abstract keyword is used with Windows class to make this class an abstract class which means no object can be created using this class.

Two private instance variable width and height. Private means they are not accessible outside this class.

Then getWidth and getHeight methods are used to return width and height.

The constructor takes two integer type variables var1 and var2. These two variable are used to initialize the variables width and height. Constructor has the same name as that of the class.

Method paint() is an abstract method with the return type void which has no parameters.  

So here is what the class with all its methods and instance variables looks.

public abstract class Window {

private int width, height;

public Window(int a, int b) {width = a; height = b;}

public int getWidth(){ return width; }

public int getHeight(){ return height; }

public abstract void paint();

}

You might be interested in
Imagine that you are creating a website for a client. How will you interact with the client, gather requirements, and update the
Arisa [49]

Answer:

Be polite and open to ideas

Explanation:

Before going make a list of things you need to know for sure. You could also provide some samples. Make sure you take many notes on what they want! Speak with your client and ask them how and when they want to be updated on progress, some might want to know once a week others may want to receive a progress report every day. Communication is always key and will always help you provide good service.

Hopefully, this helps!

4 0
2 years ago
Read 2 more answers
What does gps stand for ?
frutty [35]
GPS stands for Global Positioning System
3 0
3 years ago
Read 2 more answers
Hey i need someone to talk to because of life it would be amazing if you can help me
Leya [2.2K]
Talk to you about... :)
3 0
3 years ago
What is a type of local network that people can use to access the Internet?
ExtremeBDS [4]

Id say Router is the answer based on your Question.

Router - is a device used to host a network signal which people will require the SSID(network-name) to connect to.

It is a bit confusing because the correct answer is SSID  which leads me to belive Public Wi-Fi is also correct..

4 0
3 years ago
Read 2 more answers
What was Pike's objective on his first expedition in 1805?​
Furkat [3]
Zebulon Pike, the U.S. Army officer who in 1805 led an exploring party in search of the source of the Mississippi River, sets off with a new expedition to explore the American Southwest. Pike was instructed to seek out headwaters of the Arkansas and Red rivers and to investigate Spanish settlements in New Mexico.
8 0
3 years ago
Other questions:
  • Which of the following statements is true regarding ARPANET? Select 3 options. It was a product of Bell Laboratories and was int
    9·1 answer
  • What so the term used to describe how many bits are used in each pixel?
    7·1 answer
  • In gaming, "rendering" refers to:
    12·2 answers
  • Wireshark capture files, like the DemoCapturepcap file found in this lab, have a __________ extension, which stands for packet c
    6·1 answer
  • A technician is configuring a new SOHO multifunction wireless router at a customer's location to provide network access to sever
    7·1 answer
  • All of the following are advantages of database-stored information, except ______________. Multiple Choice
    7·1 answer
  • Computer network reduces the cost of operation​
    14·1 answer
  • Where are methods listed in a UML class diagram showing three parts?
    8·1 answer
  • Please answer this question​
    8·1 answer
  • Which of the following is NOT a reason we use subprograms?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!