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
Marrrta [24]
3 years ago
9

Write a subclass named 'ReadWrite' with the following additional behavior: Any necessary constructors. a method named 'setVal' t

hat 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:
nataly862011 [7]3 years ago
6 0

Answer:

Java Class given below

Explanation:

class ReadOnly

{

protected int val;

public ReadOnly(int arg)

{

val = arg;

}

public int getVal()

{

return val;

}

}

class ReadWrite extends ReadOnly

{

private boolean dirty;

public ReadWrite(int arg)

{

super(arg);

dirty = false;

}

public void setVal(int arg)

{

val = arg;

dirty = true;

}

public boolean isDirty()

{

return dirty;

}

}

You might be interested in
Write the definition of a class Clock. The class has no constructors and three instance variables. One is of type int called hou
maksim [4K]

Answer:

Following are the program definition in the Java Programming Language.

//define a class

public class Clock

{

//set integer type variable and initialize value

private int hours=12;

//set boolean type variable and initialize value

private boolean isTicking=true;

//set integer type variable and initialize value

private Integer diff=5;

}

Explanation:

Following are the description of Code.

  • Firstly define a class "Clock" with the "private" access modifier.
  • Then,  set the integer data type variable "hours" with the "private" access modifier and assign value 12 in that class.
  • After that, set the boolean data type variable "isTicking" with the "private" access modifier and assign value "true".
  • Finally set Integer class variable "diff" with the the private access modifier and assign value 5.
3 0
3 years ago
A _____ cloud allows an organization to take advantage of the scalability and cost-effectiveness that a public cloud computing e
balu736 [363]

Answer:

Hybrid

Explanation:

Hybrid cloud is a solution that combines a private cloud with one or more public cloud services, with proprietary software enabling communication between each distinct service.

5 0
3 years ago
Rubbing two sticks together to make a fire is an example what
Jet001 [13]
Rubbing two sticks together will cause friction
7 0
3 years ago
Read 2 more answers
I hate school...............
butalik [34]

Answer:

Check your email.

Explanation:

8 0
3 years ago
Read 2 more answers
Which of the following careers is part of the Printing Technology pathway?
torisob [31]
Textile designer i think

6 0
3 years ago
Other questions:
  • Which three of the following are used for mobile Internet access?
    12·2 answers
  • What is the easiest way to be sure you have selected all of the content related to a specific tag?
    11·1 answer
  • What is the relationship between ionic bonds and cleavage
    13·1 answer
  • 5. Tricks of the language commercials use are called Rhetorical Devices?
    9·1 answer
  • The work principle is not always true<br> T or F
    11·2 answers
  • Charts are more effective in attaining attentionthen others methods of presenting data. Do you agree?
    10·1 answer
  • Your team will write a function that reverses a C-string, to practice using pointers. You must use pointers and C-strings for th
    6·1 answer
  • I am not a living being, I am a cylindrical shape that has three to eight sides. I never die. I can build anything again. What i
    5·1 answer
  • 4.(L.5.1.A) Select the sentence that includes an interjection,
    12·1 answer
  • Different Betweens ServerPc And Desktop Pc ~
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!