Академический Документы
Профессиональный Документы
Культура Документы
1. a. False
b. True
c. True
d. False
e. False
3. public int AA(int a, int b) => public void AA(int a, int b)
5. a) i. CC one = new CC(); = line 1
ii. CC two = new CC(5, 6); = line 3
iii. CC three = new CC(2, 8, 3.5); = line 4
b) public CC(){
u = 0;
w = 0;
v = 0;
}
c) public CC(int a){
u = a;
v = 0;
w = 0;
}
d) public CC(int a, int b){
u = a;
v = b;
w = 0.0;
}
e) public CC(int a, int b, double d){
u = a;
v = b;
w = d;
}
7. Automobile()
9. A class can have more than one constructor. A constructor without parameters
is called the default constructor. Constructors automatically execute when a class
object is created.
15. firstClock.print();
System.out.println();
secondClock.print();
System.out.println();
No output cuz don’t have method in the statement.
17. A shallow copy is a copy of the reference pointer to the object, where as
a deep copy is a copy of the object itself. In Java, objects are kept in the
background, what you normally interact with when dealing with the objects is the
pointers. The variable names point to the memory space of the object.
19. When I use the assignment operator to copy the value of aa into bb. Then
both value of aa and bb are same.
if(n == n2)
System.out.println();
}
}