Get Full Version of the Exam
http://www.EnsurePass.com/1z0-808.html
Question No.81
Given:
And the code fragment:
Which code fragment, when inserted at line 14, enables the code to print Mike Found?
-
int f = ps.indexOf (p2)
-
int f = ps.indexOf (Patient (quot;Mikequot;) );
-
int f = ps.indexOf (new Patient quot;Mikequot;) );
-
Patient p = new Patient (quot;Mikequot;);Int f = ps.indexOf (p)
Correct Answer: A
Question No.82
Given the code fragment:
What is the result?
-
A B C
-
A B C D E
-
A B D E
-
Compilation fails.
Correct Answer: C
Question No.83
What is the name of the Java concept that uses access modifiers to protect variables and hide them within a class?
-
Encapsulation
-
Inheritance
-
Abstraction
-
Instantiation
-
Polymorphism
Correct Answer: A
Explanation:
Using the private modifier is the main way that an object encapsulates itself and hide data from the outside world.
Question No.84
Given the following code:
What is the output?
-
44
-
35
-
47
-
54
-
45
F. 421
Correct Answer: E
Question No.85
Given the code fragment:
What is the result?
-
[Robb, Rick, Bran]
-
[Robb, Rick]
-
[Robb, Bran, Rick, Bran]
-
An exception is thrown at runtime.
Correct Answer: A
Question No.86
Given the code fragment:
What is the result?
-
Sum is 600
-
Compilation fails at line n1.
-
Compilation fails at line n2.
-
A ClassCastException is thrown at line n1.
-
A ClassCastException is thrown at line n2.
Correct Answer: C
Question No.87
Given the code fragment:
What is the result? A. 5 : 5
B. 10 : 10
C. 5 : 10
D. Compilation fails.
Correct Answer: B
Question No.88
Given the following class:
Which two changes would encapsulate this class and ensure that the area field is always equal to length * height whenever the Rectangle class is used?
-
Call the setArea method at the end of the setHeight method.
-
Call the setArea method at the beginning of the setHeight method.
-
Call the setArea method at the end of the setLength method.
-
Call the setArea method at the beginning of the setLength method.
-
Change the setArea method to private.
-
Change the area field to public.
Correct Answer: AE
Question No.89
Given the code fragment:
What is the result?
-
An exception is thrown at runtime.
-
Compilation fails. C. 13480.0
D. 13480.02
Correct Answer: C
Question No.90
Given the code fragment from three files:
Which code fragment, when inserted at line 2, enables the code to compile?
-
Option A
-
Option B
-
Option C
-
Option D
-
Option E
Correct Answer: E
Get Full Version of the Exam
1z0-808 Dumps
1z0-808 VCE and PDF