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
ozzi
3 years ago
15

The 'client area' of a window is the area used to display the contents of the window (thus a title bar or border would lie outsi

de the client area). For the Window class, the client area is nothing more than the entire window, and thus the height of the client area is nothing more than the value of the height instance variable. Assuming the existence of a Window class with existing methods, getWidth and getHeight, add the method getClientAreaHeight that returns the height (an integer) of the client area of the window.
Computers and Technology
1 answer:
Lady_Fox [76]3 years ago
4 0

Answer:

<u>Window.java</u>

  1. public class Window {
  2.    int width;
  3.    int height;
  4.    public Window(int width, int height){
  5.        this.width = width;
  6.        this.height = height;
  7.    }
  8.    public int getWidth(){
  9.        return width;
  10.    }
  11.    public int getHeight(){
  12.        return height;
  13.    }
  14.    public int getClientAreaHeight(){
  15.        return getHeight();
  16.    }
  17. }

<u>Main.java</u>

  1. public class Main {
  2.    public static void main (String [] args) {
  3.        Window win1 = new Window(12, 15);
  4.        System.out.println(win1.getClientAreaHeight());
  5.    }
  6. }

Explanation:

<u>Window.java</u>

There is a Window class with two int type attributes, width and height (Line 1 - 3).

The constructor of this class will take two inputs, width and height and set these input to its attributes (Line 5 - 8). There are two methods getWidth and getHeight which will return the value of attributes width and height, respectively (Line 10 - 16).

The required new method getClientAreaHeight is defined in line 18 -20. This method will call the getHeight method to return the height value of the window (Line 19).

<u>Main.java</u>

We test the Window class by creating one Window instance and call the getClientAreaHeight method and print the return output (Line 1 -6).

We shall see 15 is printed.

You might be interested in
Peak download rate for a 4g network is __________. select one:
german
It's a.
1gigbyte per second.
6 0
3 years ago
Read 2 more answers
MDM consolidates data from various data sources into a __________, which then feeds data back to the applications, thereby creat
Pepsi [2]

Answer:b) Master reference file(MRF)

Explanation: Master reference file is the collection of data that persist the schedules records for the maintenance and administration. It is the UDC version tool .

It helps in the managing the data content present in the database, archiving and tracing any changes on the database over certain time.Master data management is the managing of data's integrity .It  send the collected critical data to the master reference files.

Other given options are incorrect because backup file is for creating data backup, central directory is record of the data of users and other information and data silo is kind of fixed data having the governance of any organization.Thus, these factors don't help in the critical information management.Thus, the correct option is option(b).

3 0
4 years ago
Nvm, Its B.
denis-greek [22]
B) which ice cream flavor do the most student prefer?
6 0
3 years ago
What's the difference between a game of skill and game of chance?
Hunter-Best [27]
If its a game of skill, the game depends on how good you are in gaming, if its a game of chance it depends on what are the chances of you winning
5 0
3 years ago
Jamie is using the UNIX file system to work on his computer. He puts a dot before the file extension to separate it from the fil
NARA [144]

Answer: as a file extension

Explanation:

4 0
4 years ago
Read 2 more answers
Other questions:
  • Declare a character variable letterStart. Write a statement to read a letter from the user into letterStart, followed by stateme
    10·1 answer
  • A ___ is a node (or a device) that connects two different networks together and allows them to communicate.
    12·1 answer
  • Which programming language represents data in the form of a series of zeros and ones​
    7·1 answer
  • When you send large attachments, you are not
    14·1 answer
  • What is the difference between a crosstab query and a subquery?
    11·2 answers
  • In the following nested loop structure, which loop does the program EXIT first?
    6·1 answer
  • Three reasons why users attach speakers to their computer
    8·1 answer
  • How to resize an image in photoshop without losing quality.
    11·1 answer
  • Page 1. I who invented computer?​
    9·1 answer
  • How does a file reader know where one line starts and another ends?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!