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
Where should a user disable virus protection settings that might prevent the boot area of the hard drive from being altered?
leonid [27]

Answer:BIOS setup

Explanation:

BIOS setup is a program used alter or changes the settings of a computer hardware system,it is in the BIOS setup that the user of a company system can disable the Virus and other forms of protection which prevents the system from performing efficiently. To gain access to the BIOS setup one has to turn off the system and wait for up to 5seconds before turning on,press the Esc key constantly for some time until the Start up menu opens then press the F10 to gain access to the BIOS setup.

3 0
3 years ago
Which line of code will print I like to code on the screen? print("I like to code") print(I like to code) print("I LIKE TO CODE"
Bad White [126]

Answer:

print("I like to code")

Explanation:

In the Programming Languages, print() function is used to print any string, display any output or both at the same time as well as we can print it one by one. We can also print addition, subtraction, multiplication and other problems directly without saving it in other objects or variables.

In the above statement, the correct method of printing any string is to write that string inside the parameter with a double-quote.

The second option is incorrect because in it double-quote is not used.

The third option is incorrect because the following sequence is not correct.

4 0
3 years ago
Read 2 more answers
The _______ provides access to the internet; may also be internal?
VikaD [51]
World Wide Web (WWW)? I honestly don't know.
8 0
3 years ago
How could this<br> innovation change society?
Lisa [10]

Answer:

invention such as new tool devices progress and resistance benefits to society inventions selfie lies and provide new way to build move communicate heal learn and play

7 0
2 years ago
A specialized storage device or group of storage devices that provides centralized fault-tolerant data storage for a network____
gogolik [260]

Answer: NAS(Network-attached storage)

Explanation:

NAS(Network-attached storage) is the file storage in computer server which links to computer network. It is used by heterogeneous client or group of other various users to access files data.

  • It can retrieve data from shared folder storage in network.It can provide serving file feature through standard, hardware,configuration or  software.
  • It provides high speed service of sharing and serving files, continuous work in faulty situation, easy configuration, simple accessing of data etc.

5 0
3 years ago
Other questions:
  • Random-access memory (RAM) is able to quickly access data because it is arranged in which of the following configurations?
    8·2 answers
  • Software obtained illegally is called open-source software. true / false
    15·1 answer
  • The most commonly used video formats are the mpeg-____ format, the windows media audio/video format, and the audio visual interl
    12·1 answer
  • If your BAL is .10 you can expect a _______ drop in complex performance compared to the sober level
    6·1 answer
  • When discussing the business requirements of a WLAN design, what is the first question that should be posed
    15·1 answer
  • Write a method that accepts a string as an argument and checks it for proper capitalization and punctuation. The method should d
    14·1 answer
  • Formatting means ____________
    12·2 answers
  • Give 5 examples for software ​
    9·1 answer
  • What is the answer ????​
    13·2 answers
  • In your own opinion how comes the surface grinding machine is called a highly accurate machine tool?​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!