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
Which types of attacks are thwarted by complex passwords that are combinations of upper and lower case letters, numbers, and spe
lesantik [10]

The types of attacks that are known to be thwarted by complex passwords that are combinations of upper and lower case letters, numbers, and special characters are said to be Brute Force Attacks.

What is Brute Force Attacks?

This is known to be an attack that is said to be a very  crude type of attack and it is often seen as a brute-force attack.

Note that is one that does not depend on lists of passwords, but it is one that often tries all the  very possible combinations of permitted character types.

Hence, this type of attack was known to be historically seen as ineffective, and it is said to be The types of attacks that are known to be thwarted by complex passwords that are combinations of upper and lower case letters, numbers, and special characters are said to be Brute Force Attacks.

Learn more about Brute Force Attacks from

brainly.com/question/17277433

#SPJ1

3 0
2 years ago
Swapping two numbers
Tju [1.3M]

Answer:

Swapping two numbers means exchange the values of two variables with each other.

8 0
3 years ago
When typing an outline, you can move a point from a lower level to a higher level by changing the list level from the outline me
Arte-miy333 [17]
A shift+Tab
I hope it’s work
6 0
3 years ago
Write a program that repeatedly shows the user a menu to select the shape form three main shapes or to print the shapes created
fomenos

Answer:

Explanation:

The following code is written in Python. It creates a program that keeps printing out a menu allowing the user to create shapes. These shapes are saved in an array called shapes. Once the user decides to exit, it prints all of the shapes in the array along with their total area. The output can be seen in the attached picture below. Due to technical difficulties, I have added the code as a txt file below.

3 0
2 years ago
Question 4
Tcecarenko [31]

Answer: squared ← number * number

Explanation:

4 0
3 years ago
Other questions:
  • Is Digital technology always better or should we champion or even return to innovative of analog machines and experiences? Apex
    13·1 answer
  • In the year of our Lord 66, the Emperor Nero, being at that time in the twenty-ninth year of his life and the thirteenth of his
    10·1 answer
  • For an machine using 2-dimensional even parity for error detection/correction, and the following received bytes, where is the er
    9·1 answer
  • When citing an Internet source:__________. a. it is ok to omit quotation marks if you change some words in the original sentence
    8·1 answer
  • Problem 1: you must write a method for this problem called sentenceAnalyzer Write a program that reads a sentence from the keybo
    10·1 answer
  • 1. Which sentence best expresses the main idea
    12·1 answer
  • Describe how data is transmitted using half-duplex serial data transmission.
    9·1 answer
  • Which sensitivity level is not a default available in Outlook 2016?
    9·2 answers
  • Please help me please it's urgent​
    6·1 answer
  • Physical education is the body's ability to function effectively and efficiently without excessive farigue. TRUE/FALSE
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!