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
Research the disadvantages of the computer and explain them.​
lisabon 2012 [21]

Answer:

Too much sitting-affects the back and makes our muscles tight

Carpal tunnel and eye strain-moving your hand from your keyboard to a mouse and typing are all repetitive and can cause injuries

Short attention span and too much multitasking-As you use a computer and the Internet and get immediate answers to your questions and requests, you become accustomed to getting that quick dopamine fix. You can become easily frustrated when something doesn't work or is not answered in a timely matter.

3 0
3 years ago
Which of the following is part of the 6-by-6 rule?<br><br> i need help!!!!!
Digiron [165]
No more than six lines, and no more than six words in a 6 by 6 rule.
5 0
2 years ago
Which of the following is an external hard drive
fredd [130]

Answer:

Question 1 = D

Explanation:

7 0
2 years ago
Write the application of computer in education and communication​
daser333 [38]

Answer:

Technology has profoundly changed education in many ways. Technology has greatly expanded access to education. In medieval times, books were rare and only an elite few had access to educational opportunities. Individuals had to travel to centers of learning to get an education. Today, massive amounts of information (books, audio, images, videos) are available at one’s fingertips through the Internet, and opportunities for formal learning are available online worldwide through online learning, podcasts, traditional online degree programs, and more. Access to learning opportunities today is unprecedented in scope thanks to technology.

Technology is a gift of God. After the gift of life, it is perhaps the greatest of God's gifts. It is the mother of civilizations, of arts, and sciences. Technology has certainly changed the way we live. It has impacted different facets of life and redefined living. Undoubtedly, technology plays an important role in every sphere of life. Several manual tasks can be automated, thanks to technology. Also, many complex and critical processes can be carried out with ease and greater efficiency with the help of modern technology. Thanks to the application of technology, living has changed and it has changed for the better. Technology has revolutionized the field of education. The importance of technology in schools cannot be ignored. In fact, with the onset of computers in education, it has become easier for teachers to impart knowledge and for students to acquire it. The use of technology has made the process of teaching and learning all the more enjoyable.

Technology has also begun to change the roles of teachers and learners. In the traditional classroom, the teacher is the primary source of information, and the learners passively receive it. This model of the teacher as the “sage on the stage” has been in education for a long time, and it is still very much in evidence today. However, because of the access to information and educational opportunity that technology has enabled, in many classrooms today we see the teacher’s role shifting to the “guide on the side” as students take more responsibility for their learning using technology to gather relevant information. Schools and universities across the country are beginning to redesign learning spaces to enable this new model of education, foster more interaction and small group work, and use technology as an enabler.

Explanation:

7 0
2 years ago
Creating a map of your current knowledge is called __________.
poizon [28]

Answer:

D - Concept-mapping

Explanation:

3 0
3 years ago
Other questions:
  • Blackbaud is a company that supplies services and software designed for nonprofit organizations. Which type of e-commerce websit
    8·1 answer
  • Trisha is looking for a new table style. What is the fastest way for her to preview how different styles in the gallery would lo
    13·1 answer
  • which of these describe raw data?check all of the boxes that apply A) what a person buys B) where a person lives C) data that ha
    9·1 answer
  • Assume that sentence is a variable that has been associated with a string consisting of words separated by single space characte
    12·2 answers
  • An address has a house number, a street, an optional apartment number, a city, a state and a postal code. Define the constructor
    5·1 answer
  • Write a program that creates an integer array with 40 elements in it. Use a for loop to assign values to each element of the arr
    5·1 answer
  • WILL GIVE BRAINLIEST!!!!!
    8·1 answer
  • Handhed computer is otherwise called as<br> 1.laptop<br> 2.Notebook<br> 3.Palmtop
    7·1 answer
  • For some reason my code is not printing in python. It doesn't give me an error is just not printing no thing shows up
    13·1 answer
  • Answered
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!