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
nirvana33 [79]
3 years ago
8

Given the class 'ReadOnly' with the following behavior: A (protected) integer instance variable named 'val'. A constructor that

accepts an integer and assigns the value of the parameter to the instance variable 'val'. A method name 'getVal' that returns the value of 'val'. Write a subclass named 'ReadWrite' with the following additional behavior: Any necessary constructors. a method named 'setVal' that accepts an integer parameter and assigns it the the 'val' instance variable. a method 'isDirty' that returns true if the setVal method was used to override the value of the 'val' variable.
Computers and Technology
1 answer:
Dafna1 [17]3 years ago
7 0

Answer:

I believe you want a subclass so here it is!

public class ReadWrite extends ReadOnly {

public ReadWrite(int initialValue){

super(initialValue);

}

private boolean modified = false;

public void setVal(int x) {

val = x;

modified = true;

}

public boolean isDirty() {

return modified;

}

}

Explanation:

I might be wrong, just check through it in case

Hope this helped

:)

You might be interested in
A virtual meeting is the same thing as a/an A. online meeting. B. VoIP. C. seminar. D. convention.
Kryger [21]
I believe it's A. online meeting
5 0
3 years ago
You need to fax a portion of a map from a large hard-cover atlas to a client from an internal fax-modem. To fax the map, the bes
Kay [80]
The fax modem is used to send and receive fax messages by only having phone line (fax machine is not required). The scanned documents should be saved as digital file (image or PDF format) in order to be sent. So, in order to send a portion of a map you should first convert the map into digital file and than simply send it through the fax modem. The best way to convert it to a digital file is to use an optical character recognition (OCR). 
6 0
3 years ago
30% of the mass of an objects is 24 kilograms. use this fact to find:
Triss [41]

Answer:

chemați. mfvd5. fn. cfcfcfcfcfcfcf 4t

6 0
3 years ago
What is the Multiple Source Test
Andrews [41]
It's a test Where you can research your answers Like the internet,Library,etc to find your answers.
5 0
3 years ago
Read 2 more answers
You have a network with a subnet of 172.16.17.0/22. Which of the following is a valid host address?A. 172.16.17.1 255.255.255.25
Licemer1 [7]

Answer:

E. 172.16.18.255 255.255.252.0

Explanation:

Oh goodie, this is my home turf.

The answer is E) 172.16.18.255 255.255.252.0

This is because your subnet network ID includes mask \22, which means the ending with 255 255.255.252.0, which is standard for Class B. Only option E falls as an adequate host due to the network being 172.16.16 and broadcasting 16.19.

7 0
3 years ago
Other questions:
  • At what point is an idea protected by copyright?
    7·2 answers
  • HEY DO U LIKE TRAINS!
    7·1 answer
  • When driving, your attention is __________.
    5·2 answers
  • Which registry hive is loaded first during windows startup?
    5·1 answer
  • Why does a HTML seen to work even when its broken? why does the code sometimes turn pink?
    9·1 answer
  • Ebba received a message from one of her tech support employees. In violation of company policy, a user had downloaded a free pro
    14·1 answer
  • History timeline: who developed what elements first Windows OS and Apple OS?
    13·2 answers
  • Question 2 of 3
    7·2 answers
  • The Operating System is used to locate, move, and copy files.
    10·1 answer
  • Identify the correct characteristics of Python tuples. Check all that apply.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!