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

Write a class definition of a class named 'Value' with the following: a boolean instance variable named 'modified', initialized

to false an integer instance variable named 'val' a constructor accepting a single parameter whose value is assigned to the instance variable 'val' a method 'getVal' that returns the current value of the instance variable 'val' a method 'setVal' that accepts a single parameter, assigns its value to 'val', and sets the 'modified' instance variable to true, and a boolean method, 'wasModified' that returns true if setVal was ever called.
Computers and Technology
1 answer:
m_a_m_a [10]3 years ago
8 0

Answer:

The following program are:

public class Value {  // Define a class named Value which is public type

private boolean modified = false; // a Boolean instance variable named 'modified',

private int val;

public Value(int i) { val = i; }

public int getVal() { return val; }

public void setVal(int i) { val = i; modified = true; }

public boolean wasModified() { return modified; }

}

Explanation:

Firstly, a class defines "Value" and then take a Boolean variable "modified" initialize the value false and then take an integer variable "val" and after that we create a constructor taking a parameter in which variable is assigned to the "val" and then we create an integer type function "getVal()" which returns the value of the "val", and then we create a void type function "setVal()" which takes parameter assign to the value to the "val" and we set the value in the "modified" is true and after all we create a Boolean type function, "wasModified()" which give an output true, if the function "setVal()" was called

You might be interested in
Use the drop-down menus to complete the steps for rearranging the layout of a form.
trasher [3.6K]

Answer:

1. Open the Form

2. Arrange tabs

3. Layout view

4. Reoder and arrange the Layout as desired

5. Press Ctrl + A

6. Choose the remove Layout button

7. Click Save

I am not sure

8 0
3 years ago
1⁰=?<br> Is equal to...........
Murrr4er [49]

Answer:

1

Explanation:

Anything to the 0th power is 1. However, 0⁰ is undefined.

5 0
4 years ago
Read 2 more answers
If you'd like to queue multiple exports and keep working on a different project in Premiere Pro, what method should you use?
pogonyaev

Answer:

Export to Adobe Media Encoder CC only

Explanation:

5 0
3 years ago
Help, with gaming unlocked
Leto [7]

Answer:

C. empathic understanding

8 0
4 years ago
Chris needs to create a simple web page with HTML. Which tool will he use? HyperText Web browser Text editor Operating software
kiruha [24]

Answer:

The answer is "Text editor".

Explanation:

It is a computer program, which is used to provide editing on the plain text, and for this editing, we use a text editor. This tool differs from word processors software because it doesn't add additional text editing metals. In this tool, we also write the HTML code, and the incorrect choice can be defined as follows:

  • HyperText is a wrong choice because in these two or more pages are linked and it is used to move from one page to another.
  • The Web browser is also a wrong choice because it is used to display the design of the web page.
  • Operating software is also a wrong choice because it system software in which all things are done.  
3 0
3 years ago
Other questions:
  • Our company is only interested in purchasing a software upgrade if it leads to faster connectivity and data sharing. The old sof
    7·1 answer
  • Processing is handled by the computer’s central processing unit (cpu).​ <br> a. True <br> b. False
    6·1 answer
  • Assume that a text box named PhoneNumberTextBox appears on a form and contains the phone number 414-555-5555. What value will di
    5·1 answer
  • Nascar has inserted an image into his document but needs the image to appear on its own line Which option should he choose?
    12·2 answers
  • What are personal skills?
    5·1 answer
  • A(n) ________ is a wonder of miniaturization combining a CPU, GPU, and sundry other support logic onto a single silicon die, sav
    9·1 answer
  • A form of segmentation that is based on user usage rate, user status, purchase occasion, and benefits sought is _________.
    13·1 answer
  • What is office course<br> how to learn office course
    12·1 answer
  • Scripting languages are unique computer languages with a specialized function. explain what scripting languages do, and how this
    7·1 answer
  • He was called "The father of computing c_______ B_______​
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!