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
A _____ is a network that uses multiple access points to link a series of devices that speak to each other to form a network con
morpeh [17]
I think the answer is WAN (wide area network)
6 0
3 years ago
Explain how to implement two stacks in one array A[1..n] in such a way that neither stack overflows unless the total number elem
algol [13]

Answer:

Check explanation

Explanation:

Two stacks can make use of one array by utilizing various stack pointers that begins from different ends of an array. Looking at the array A[1...n], the first stack will drive elements that starts from position 1 as well as to move its' pointer to n.

The Second stack will begin at the n position and motion its' pointer to 1. The best likely divide is to offer each stack a half of an array. whenever any of two stacks transverse the half-point, an overflow can happen but for that overall number of elements, it must be n

5 0
3 years ago
In a relational database, the three basic operations used to develop useful sets of data are:
lesya692 [45]
<span>Which is not a component of a database that describes how data is stored?</span>
6 0
4 years ago
What does Technology mean to you?​
brilliants [131]
Technology is the collection of techniques, skills, methods and processes used in the production of goods or services or in the accomplishment of objectives, such as scientific investigation. Technology can be the knowledge of techniques, processes, etc. or it can be embedded in machines, computers, devices and factories, which can be operated by individuals without detailed knowledge of the workings of such things.
8 0
3 years ago
Read 2 more answers
What's the difference between kilobyte and kibibyte, and why was the IEC convention for computer international memories made???
Masja [62]

Answer:

The Kibibyte was developed to take place of the kilobytes in the computer science context where the Kilobyte stands for 1024 bytes. And the Kilobyte interpretation to mean 1024 bytes, conflicts the Standard definition of the prefix kilo or 1000. And the IEC convention for computer international memories was made to define the international standards for electrical, electronic and related technologies.

Explanation:

Please check the answer section.

8 0
4 years ago
Other questions:
  • The PATH environment variable.
    5·1 answer
  • What common communication devices are used in homes to connect to the internet and remote networks and what capabilities do thes
    10·1 answer
  • When RadioButton objects are contained in a group box, the user can select only one of the radio buttons on the panel.
    12·1 answer
  • The function below takes two parameters: a string parameter: CSV_string and an integer index. This string parameter will hold a
    14·1 answer
  • Among the following, which is the best protection against ransomware?
    8·1 answer
  • Does anyone know the answer for this? I’m extremely confused.
    8·2 answers
  • Is there a way to earn free robux
    7·2 answers
  • What is the function of a breadcrumb trail in a website ?
    10·2 answers
  • You are an IT network administrator at XYZ Limited. Your company has critical applications running of its Ubuntu Linux server. C
    6·1 answer
  • What ribbon command on the home tab can you use to change a cell fill color
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!