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
Suppose you want to delete an existing file from within word. What would you do?
Oksana_A [137]
Go in to ur files and find the file and delete it
5 0
3 years ago
Write a full class definition for a class named Counter, and containing the following members: A data member counter of type int
vfiekz [6]

// making the class

class Counter {

int counter;

int limit;

// Constructor

Counter(int a, int b){

counter = a;

limit = b;

}

// static function to increment

static increment(){

if(counter<limit)

nCounter+=1;

}

// Decrement function

void decrement(){

if(counter>0)

nCounter-=1;

}

int getValue(){

return counter;

}

static int nCounter;

int getNCounters(){

return nCounter;

}

};

// Initializa the static

int Counter::nCounter = 0;

4 0
3 years ago
안녕 또 나야 난 너에게 미래의 메시지를 전하러 왔어 01100011 01101111 01101101 01101111 00100000 01111001 00100000 01101100 01101111 00100000 01101101
sashaice [31]

Answer:

i think its 01100001

Explanation:

4 0
3 years ago
Read 2 more answers
In cell j6, enter a formula to determine the cost of gas if the customer chose that option as indicated in column i. if the cust
Alex73 [517]

Answer:

a t t i c

Explanation:

7 0
3 years ago
In what year did alienware introduce alienfx lighting zones into their pc's?
ser-zykov [4K]
The answer to the question asked  above is 2006. 
<span>Alienware introduce alienfx lighting zones into their pc's on 2006.</span>

Hope my answer would be a great help for you.    If you have more questions feel free to ask here at Brainly.
8 0
3 years ago
Other questions:
  • 5. Are you more honest in your online communication? Explain your response.
    6·1 answer
  • The Security Development Life Cycle (SDLC) is a general methodology for the design and implementation of an information system.
    5·1 answer
  • Before his job interview, Shabnam took the time to carefully wash and iron his best khaki pants and a button-down shirt. He even
    15·2 answers
  • Mobile computing has two major characteristics that differentiate it from other forms of computing. What are these two character
    8·1 answer
  • A presentation has bullet points that move. The presenter wants to use these bullet points in several other places in the presen
    6·1 answer
  • The purpose of a function that returns "void" is:_________. A) To satisfy compiler warnings B) To package a repeated task as a f
    7·1 answer
  • You are managing an FTP server installed in Ubuntu Server. The server has created a very large log le, vsftpd.log. Which command
    14·1 answer
  • A SOCCER club uses ICT to
    10·1 answer
  • if you were determining what was expected of you simply by looking at media, what messages would you take away?
    8·2 answers
  • which scheduling algorithm allocate the CPU firt to the process that request the CPU first, (a) first come first serve,(b) short
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!