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
TEA [102]
3 years ago
10

Consider the following class definition.public class Rectangle{private double length;private double width;public Rectangle(){len

gth = 0;width = 0;}public Rectangle(double l, double w){length = l;width = w;}public void set(double l, double w){length = l;width = w;}public void print(){System.out.println(length + " " + width);}public double area(){return length * width;}public void perimeter(){return 2 length + 2 width;}}Suppose that you have the following declaration.Rectangle bigRect = new Rectangle();
Which of the following sets of statements are valid in Java?
(i) bigRect.set(10, 5);
(ii) bigRect.length = 10;bigRect.width = 5;
Computers and Technology
1 answer:
fredd [130]3 years ago
7 0

Answer:

The answer is "Option (i)".

Explanation:

In the given java code a class is defined that name is "Rectangle" inside a class two global private double datatype variable is defined that is "length and width". A default constructor is defined that contains the value of private variables. In the next line, a parameterized constructor and a set function is defined that contain the parameter values. Then three function is defined that is "print, area, and perimeter" in which print function prints value and area, perimeter function calculate values.

  • Option (i) is correct because it is the correct way to call the function.
  • Option (ii) is incorrect because the private member does not accessible outside the class.

You might be interested in
Java uses ____ to implement method lookup.A) a jump tableB) an inheritance treeC) restricted accessD) polymorphism
sashaice [31]

Answer:

D) polymorphism

7 0
4 years ago
The RAM memory of a computer contains the volatile memory, which includes
lara31 [8.8K]

The RAM memory of a computer contains the volatile memory, which includes; Websites recently visited

<h3>Random Access Memory(RAM)</h3>

Random access memory (RAM) is defined as a computer's short-term memory that it utilizes to handle all active tasks and applications.

Now, no single program, file, game, or stream would work without a RAM. Thus, RAM is a temporary storage that goes away when we shut down the computer.

Examples of things that RAM store from the options given is only websites visited recently.

Read more about Random Access Memory at; brainly.com/question/86807

3 0
3 years ago
You are building your own computer, and you are ready to select
KiRa [710]

Answer:

D

Explanation:

It's because you need a system software so the user can understand what the hardware is saying because the hardware only uses binary codes.

7 0
3 years ago
In the next five years there are expected to be over _____ unfilled jobs in the US in computer science.
Marta_Voda [28]

Answer:

The correct answer is D) 1 Million

Explanation:

It has been predicted that in about five years the Information Technology sector in the United States will have about 1 million unfilled roles in computer science.

Cheers!

4 0
3 years ago
Whatis Level of node ‘46’?
Ierofanga [76]

Answer:

6

Explanation:

The  tree is the hierarchical structure in the data structure, it has the properties like nodes, height, level etc.

the formula for calculating the maximum number of node at the given level.

number of nodes = 2^{l-1}

here, l is the level of node.

in the question the number of node is 46.

Substitute in the formula:

2^{l-1}=46\\ l-1=log_{2}46\\ l=5.5235+1\\l=6.6235

The Approx. value of level is 6

5 0
3 years ago
Other questions:
  • write a pseudo code and flow chart that take a number as input and prints multiplication table up to 10
    9·1 answer
  • Which data type uses more memory an integer or an unsigned integer?
    6·1 answer
  • What is the most significant result based on the development of windmills and water wheels?
    13·1 answer
  • Using information from the lesson, explain how new technologies change your experience as a consumer.
    5·2 answers
  • P3. In Section 4.2 , we noted that the maximum queuing delay is (n–1)D if the switching fabric is n times faster than the input
    8·1 answer
  • 30
    5·1 answer
  • Which of the following is not an advantage of concurrent design?
    10·2 answers
  • Write a MATLAB program to accomplish the following: Create two vectors, a and b, where vector a contains all positive integers l
    10·1 answer
  • _____ lets you look at two documents at the same time.
    14·1 answer
  • Please help me idk I suck at this stuff ​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!