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
Alexxx [7]
3 years ago
15

Which of the following statements are valid in Java? (Assume that console is Scanner object initialized to the standard input de

vice.) (i) r = console.nextDouble(); myCircle.area = 3.14 * r * r; System.out.println(myCircle.area); (ii) r = console.nextDouble(); myCircle.set(r); System.out.println(myCircle.area()); Only (i) Only (ii) Both (i) and (ii) None of these
Computers and Technology
1 answer:
san4es73 [151]3 years ago
6 0

Answer:

Both (i) and (ii) are valid in Java

Explanation:

In (i) 'area' is a variable property of the object myCircle. It could be assigned a value. In this case it has been assigned a value equal to the product of 3.14 and the square of the read input of type double from the keyboard.

After assigning a value to area, it could be printed directly to the console using the println method.

In (ii) 'area' is a method property of the object myCircle. It could be called when the value of the radius(r) has been set using a second method 'set' of myCircle. The call to myCircle.area() probably prints the area of the circle, myCircle, to the console.

In summary, though different, both are valid ways of doing the same thing.

Hope this helps!

You might be interested in
Which issue of computer ethics is concerned about the technological division in the society?​
Molodets [167]

Answer:

There are many legal and ethical issues with computers that can be exploited by bad people to do bad things. Some of those issues include illegal music and video file downloading, spyware, identity theft, phishing, keystroke logging, packet sniffing and cyberbullying

7 0
3 years ago
Read 2 more answers
When heading styles have been applied to a document, the user has the option to navigate through the document using which tab on
trasher [3.6K]

Answer: To navigate through the document

Explanation:

4 0
3 years ago
Identify 5 products/services needed by the people in our current situation.<br>​
makvit [3.9K]

Answers with Explanations:

5 Products/Services Needed by People These Days.

1. Face mask/Surgical mask - The use of face mask is considered a<em> common sense.</em> Most countries mandate people to wear this every time they go out.

2. Food Delivery service - To prevent contracting corona virus, most people prefer to have their food delivered than to dine out. This increases the demand for the food delivery service.

3. Alcohol - It has become an important habit recently to disinfect hands and other things. This is also being advertised on TV, thus many people carry it along with them.

4. Infrared Forehead Thermometer - Many establishments use this in order to quickly check the temperature of people entering.

5. Internet service - The increase use of this service is due to online learning and remote-working situations.

3 0
3 years ago
Which describes an operating system this is multitasking
xxMikexx [17]
Okay, a Multitasking Operating System(OS) allows you to run many processes (or tasks) <span>"simultaneously".

</span><span>They do not actually run at the same time, of course, since there is only one CPU.
</span>They have to take turns working but they do it really fast (:

Also, if your CPU has multiple cores then you can, run one task on one core, and another on the other core, depending of course on how many cores you CPU has e.g. Quad-Core, Dual-Core, Eight-Core.
5 0
3 years ago
And then what happened,Paul Revere rhyme
Mamont248 [21]
Wat? Well, huh I don't understand the question
6 0
4 years ago
Read 2 more answers
Other questions:
  • When leased computing resources can be increased or decreased​ dynamically, they are said to be​ ________.
    15·2 answers
  • You have just used a command that produced some interesting output on the screen. You would like to save that information into a
    10·1 answer
  • which of the following sentences uses active voice?(answers to choose from are in the photo)-this is in my computer applications
    14·2 answers
  • Create a website for an online movie rental store, using HTML (and any other client technologies) and PHP. The website should in
    8·1 answer
  • In which of the following situations will a macro make your work more efficient?
    7·1 answer
  • ​When converting plain text to hexadecimal for use with ProDiscover, you need to place ____________ between each character's hex
    6·1 answer
  • Select all that apply.
    13·1 answer
  • The part of a door frame that comes in contact with the door is the _________.
    12·1 answer
  • Which elements of a myth appear in this story from early babylon
    14·1 answer
  • Which of the following is an object such as a field which can be inserted into a document
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!