Given the definition of the Vehicle class: class Vehicle {
String name;
void setName (String name) { this.name = name;
}
String getName() { return name;
}
}
Which action encapsulates the Vehicle class?
Correct Answer:
D
Given the code fragment:
List
codes.forEach(c -> System.out.println(c)); What is the result?
Correct Answer:
C
Given the code fragment:
Which code fragment, when inserted at line n1, ensures false is printed?
Correct Answer:
C
and the code fragment?
What is the result?
Correct Answer:
A
Given the code fragment:
What is the result?
Correct Answer:
A