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
For each of the following cases, select the type of NoSQL DBMS that would fit best the needs of the situation. a. The database h
ohaa [14]

Answer:

Check the explanation

Explanation:

(a) There will be a need for the database to support a comparatively complex and complicated hierarchical internal record structure that may vary for each record. Column store NoSQL DBMS

(b)The key requirements for the database are to access a specific record structure as quickly as possible without any concern regarding the internal structure of the record. Key value store NoSQL DBMS

(c) The data are specifically well suited to be organized as a network of connections amid the data items. Graph Base NoSQL DBMS

(d) It is essential that the DBMS offers quick access to each of the records by a key value, but, in addition, it has to also allow easy access to the components of each record. Document store NoSQL DBMS

4 0
3 years ago
3. Find the best.
Tamiku [17]

Answer:

1. is the answer

Explanation:

<h2>mark me as brainlest</h2>

6 0
2 years ago
Daphne has determined that she has malware on her linux machine. She prefers to only use open-source software. Which anti-malwar
Llana [10]

Answer:

ClamAV is the open source antivirus you can in your Linux machine.

5 0
2 years ago
What is the primary limitation of free versions of antivirus applications
ddd [48]

Answer:

Please look below for the answer

Explanation:

The primary limitation is that they don’t protect in real time. They also only perform quick scans which is not that efficient. They cannot scan the Windows directory. They only install on 64-bit operating systems

Hope I helped pls mark as brainliest

3 0
3 years ago
Python 3.12 LAB: Input and formatted output: Right-facing arrow Given input characters for an arrowhead and arrow body, print a
Sloan [31]

The code below prints the required shape using the string manipulations in Python.

In Python, if we multiply a character with a number, we get that character side by side that number of times.

For example: 6 * '#' would give us → ######

Also, we can use + sign to concatenate the strings.

For example: 'hi' + ' there' would give us → hi there

We use this approaches to print the required shape line by line.

Comments are used to explain each line.

The output is attached as an image.

#get the characters from the user

base_char = input()

head_char = input()

#set first row with 6 spaces and 1 head_char

row1 = 6 * ' ' + head_char

#set second row with 6 base_chars and 2 head_chars

row2 = 6 * base_char + 2 * head_char

#set third row with row2 and 1 head_char

row3 = row2 + head_char

#print the rows to draw the shape

print(row1)

print(row2)

print(row3)

print(row2)

print(row1)

You may see another question at:

brainly.com/question/22101725

3 0
3 years ago
Other questions:
  • What do I do if someone wants to be my friend, and I don’t know who the person is online?
    12·2 answers
  • When transporting data from real-time applications, such as streaming audio and video, which field in the ipv4 header can be use
    14·1 answer
  • What is the meaning of photography​
    5·2 answers
  • Does anyone play genshin impact here?
    12·2 answers
  • The sun emits invisible _____&gt; A) electromagnetic waves B) Waves C) Radiation D) Wavelength E) Ultraviolet Light
    8·1 answer
  • Write a program that allows the user to continuously input the value n until a negative number is entered
    10·1 answer
  • Im boing exam help please In a category-based course grading system, teachers weigh a student's performance in all courses. all
    7·2 answers
  • Jak sie pisze oł na klawiaturze komputerowej
    11·1 answer
  • Im coding and need help please answer or comment to help. any skilled coders comment below
    12·1 answer
  • Identify the network and the host address in the ip address of 12.128.120.131 with a subnet mask of 255.128.0.0.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!