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
A(n) _____ is money paid for work.<br><br> A. raise <br> B. allowance<br> C. wage<br> D. grant
Andreas93 [3]

Answer:

wage

Explanation:

3 0
3 years ago
Read 2 more answers
What is a WYSIWYG program?
Anna11 [10]

Answer:

A. A program that allows you to see what the HTML code will look like in text form on the site

General Formulas and Concepts:

<u>Intro to Digital Tech</u>

  • HTML
  • CSS

Explanation:

WYSIWYG, or What You See Is What You Get, is a program designed to allow the user to preview what the HTML code would look like as a final product.

B is incorrect because we use CSS to change font, color, and other things to HTML.

C is incorrect because tutorials can be found online and would not need a program to teach HTML terminology.

D is incorrect because that would be debugging and would use AI and Smart-Sense Intelligence from the coding platform.

6 0
3 years ago
What will be the value of input_value if the value 5 is input at run time?
Lunna [17]

Answer:

15

Explanation:

The if else state is used for checking the condition and if the condition is TRUE and program can execute the statement  within the if else.

Initially input_value is 5

then the if statement check the condition 5>5, condition FALSE because 5==5

it not less than 5.

then program move to else if and check condition 5>2, condition TRUE.

then, input_value = 5 + 10=15 execute and update the value to 15.

After that, program terminate the if else statement.

Therefore, the answer is 15.

5 0
4 years ago
Which of the following are true if you pay only the minimum amount each month towards your credit card bill ?
kobusy [5.1K]
Where are the statements so i may help you 
5 0
3 years ago
What is the purpose of a primary key?
tia_tia [17]

Answer:

 Primary key:

A primary key is the collection of field value which persist unique value in the table. The primary key value can be use to represent the entire record throughout the table. In the database, each table only contain one primary key.

 The purpose of the primary key is used to implemented the relationship within the two tables in the database. More explicitly the primary key is define as, primary key is "target" that the foreign key can easily referenced. It basically consist multiple attributes in the table.

4 0
3 years ago
Other questions:
  • What advantage does a reliable web page have over published textbooks and encyclopedias?
    15·2 answers
  • Risa has a negative credit rating, and she feels obtaining a fresh loan credit is going to be quite difficult for her. Her frien
    15·1 answer
  • Which of the following is a negative impact of technology on society
    9·1 answer
  • Servlet session and JSP session have differentabilities.<br>? True<br><br>? False
    15·1 answer
  • Select the correct answer.
    15·1 answer
  • A Variable can only hold numbers<br><br> True<br><br> False
    15·2 answers
  • A(n) ________ is a server-based operating system oriented to computer networking and may include directory services, network man
    5·1 answer
  • What game is this? help mee?
    8·2 answers
  • The following method is intended to return true if and only if the parameter val is a multiple of 4 but is not a multiple of 100
    7·1 answer
  • Give two logics how a computer is better then man ​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!