Computer Applications
Consider the following statements:
Computer desktop = new Computer();
Computer Mainframe = new Computer();
Name the objects of the class given above:
- Desktop, Mainframe
- desktop, Mainframe
- Computer, Mainframe
- Computer, desktop
Java Classes
3 Likes
Answer
desktop, Mainframe
Reason — In the given statements, Computer is the class name, while desktop and Mainframe are the object names (variables that store object references). Therefore, the objects of the class are desktop and Mainframe.
Answered By
1 Like
Related Questions
Read the if program segment given below:
if(a > b) z = 25; else z = 35;Which one of the following is the correct conversion of the if program segment to ternary?
- z = a > b ? 35 : 25;
- z = a > b ? 25 : 35;
- z = a > b : 35 ? 25;
- z = a > b : 25 ? 35;
The output of the statement:
System.out.println(Character.toUpperCase('b') + 2);is:- 66
- 100
- 68
- 98
The earth spins on its axis completing one rotation in a day. The earth revolves around the sun in 365 days to complete one revolution. What is the Java concept depicted in the given picture?

- Array
- Condition
- Nested loop
- While loop
In the following method prototype to accept a character, an integer and return YES or NO, fill in the blank to complete the method prototype.
public ............... someMethod(char ch, int n)- boolean
- String
- int
- double