Exam809 SampleQuestion PDF
Exam809 SampleQuestion PDF
Exam809 SampleQuestion PDF
Given:
2. Given:
class Toy {
double price;
String color;
Toy(String color, double price) {
this.color = color;
this.price = price;
}
public double getPrice() {
return price;
}
public String getColor() {
return color;
}
}
A) T 1 IOE F
B) T IOE F
C) T IOE 1 F
D) Compilation fails.
4. Assuming that the TestResult.txt file exists and given the code fragment:
A. p1p1
p2p3
B. p1p2
p1p2p3
C. p1p2
p3
D. p1p1
p1p2p3
A) true
B) false
C) 1
D) 0
Which code fragment can be inserted at Line n1 to enable the code to print 2 4?
D) nums.stream()
.filter(n -> n%2 == 0)
.forEach( s -> System.out.print(" "+s));
Answers:
1. B and E
2. B
3. A
4. B
5. A
6. A
7. C
8. D