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
I NEED HELP RIGHT NOW !!!!!!!!!!!!!!!1
Alex17521 [72]
Are tools used to assist in conveying information during a presentation. When a speaker is verbally addressing an audience it is often necessary to use supplementary equipment and media to clarify the point. [ If the audience is large or the speaker is soft-spoken, a public address system may be employed

hope this help       plz mark brainliest
5 0
3 years ago
Read 2 more answers
‘‘Anyone in the developed world can publish anything anytime, and the instant it is published, it is globally available and read
taurus [48]
The internet made huge changes to the way news and information were shared. While it was faster to use newspapers or magazines to spread information than it was to simply tell people, they were still very inefficient compared to today's technology. With the internet today, anyone can come online and learn about what's happening in the far corners of the world. Take your question, for instance. If there was no internet, you might have to post a notice somewhere, which could take days to answer. However, since you were able to post this on the internet, I'm able to answer it within five minutes of it being posted.
8 0
3 years ago
Please help
skad [1K]
I think it might be C
6 0
4 years ago
Read 2 more answers
Match the ernerging technologies to their descriptions.
Talja [164]

Answer:

1

1

Explanation:

5 0
3 years ago
True false) keybord has two shift keys.​
deff fn [24]

Answer:

True, looking at 'em right now!

Explanation:

8 0
4 years ago
Other questions:
  • Consider a simple application level protocol built on top of udp that allows a client to retrieve a file from a remote server re
    15·2 answers
  • What is the efficiency (Big O Notation) of quicksort algorithm?
    15·1 answer
  • How many bytes of information can be stored on a hard drive?
    7·1 answer
  • When you purchase an item in a store, you may be charged __________.
    11·2 answers
  • you crossed two heterozygous red flowers (dominant color), what are your chances to have a white flower
    11·1 answer
  • "What router feature provides basic security by mapping internal private IP addresses to public external IP addresses, essential
    10·1 answer
  • What is the function of the NOS? Select all that apply.
    5·2 answers
  • Helllllllllppppppppppp
    9·1 answer
  • ____ can be used to break continuous text to one or more sentences​
    7·1 answer
  • ravi met few peoples in a party and was mixing up well those wearing expensives clothing and fair complexion . which factors are
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!