Ensurepass.com : Ensure you pass the IT Exams
2018 Jan Oracle Official New Released 1z0-853
100% Free Download! 100% Pass Guaranteed!
http://www.EnsurePass.com/1z0-853.html
Java Standard Edition 5 Programmer Certified Professional Exam
Question No: 1 – (Topic 1)
Given:
-
class One {
-
void foo() { }
12. }
-
class Two extends One {
-
//insert method here
15. }
Which three methods, inserted individually at line 14, will correctly complete class Two? (Choose three.)
-
public void foo() { /* more code here */ }
-
private void foo() { /* more code here */ }
-
protected void foo() { /* more code here */ }
-
int foo() { /* more code here */ }
-
void foo() { /* more code here */ }
Answer: A,C,E
Question No: 2 – (Topic 1)
Which two code fragments correctly create and initialize a static array of int elements? (Choose two.)
-
static final int[] a = { 100,200 };
-
static final int[] a;
static { a=new int[2]; a[0]=100; a[1]=200; }
-
static final int[] a;
static void init() { a = new int[3]; a[0]=100; a[1]=200; }
-
static final int[] a = new int[2]{ 100,200 };
Answer: A,B
Question No: 3 – (Topic 1)
Click the Exhibit button. Given this code from Class B:
-
A a1 = new A();
-
A a2 = new A();
-
A a3 = new A();
-
System.out.println(A.getInstanceCount()); What is the result?
-
Compilation of class A fails.
-
Line 28 prints the value 3 to System.out.
-
Line 28 prints the value 1 to System.out.
-
Compilation fails because of an error on line 28.
-
A runtime error occurs when line 25 executes.
Answer: A
Question No: 4 – (Topic 1)
Given:
20. public class CreditCard { 21.
-
private String cardID;
-
private Integer limit;
-
public String ownerName; 25.
-
public void setCardInformation(String cardID,
-
String ownerName,
-
Integer limit) {
-
this.cardID = cardID;
-
this.ownerName = ownerName;
-
this.limit = limit;
32. }
33. }
Which statement is true?
-
The cardID and limit variables break polymorphism.
-
The code demonstrates polymorphism.
-
The ownerName variable breaks encapsulation.
-
The setCardInformation method breaks encapsulation.
-
The class is fully encapsulated.
Answer: C
Question No: 5 – (Topic 1)
Given:
11. public class Yikes { 12.
-
public static void go(Long n) {System.out.println(quot;Long quot;);}
-
public static void go(Short n) {System.out.println(quot;Short quot;);}
-
public static void go(int n) {System.out.println(quot;int quot;);}
-
public static void main(String [] args) {
-
short y = 6;
-
long z = 7;
-
go(y);
-
go(z);
21. }
22. }
What is the result?
-
An exception is thrown at runtime.
-
int Long
-
Compilation fails.
-
Short Long
Answer: B
Question No: 6 – (Topic 1)
Given:
-
public class ItemTest {
-
private final int id;
-
public ItemTest(int id) { this.id = id; }
-
public void updateId(int newId) { id = newId; }
15.
-
public static void main(String[] args) {
-
ItemTest fa = new ItemTest(42);
-
fa.updateId(69);
-
System.out.println(fa.id);
20. }
21. }
What is the result?
-
A new Item object is created with the preferred value in the id attribute.
-
The attribute id in the Item object is modified to the new value.
-
Compilation fails.
-
An exception is thrown at runtime.
-
The attribute id in the Item object remains unchanged.
Answer: C
Question No: 7 – (Topic 1)
Click the Exhibit button. Given:
-
try {
-
A a = new A();
-
a.method1();
-
} catch (Exception e) {
-
System.out.print(quot;an error occurredquot;);
30. }
Which two statements are true if a NullPointerException is thrown on line 3 of class C?
(Choose two.)
-
The application will crash.
-
The code on line 29 will be executed.
-
The code on line 5 of class A will execute.
-
The exception will be propagated back to line 27.
-
The code on line 5 of class B will execute.
Answer: B,D
Question No: 8 – (Topic 1)
Given:
10. interface Jumper { public void jump(); }
…
20. class Animal {}
…
-
class Dog extends Animal {
-
Tail tail;
32. }
…
-
class Beagle extends Dog implements Jumper{
-
public void jump() {} 42. }
…
-
class Cat implements Jumper{
-
public void jump() {}
52. }
Which three are true? (Choose three.)
-
Cat is-a Jumper
-
Cat is-a Animal
-
Dog is-a Jumper
-
Dog is-a Animal
-
Beagle has-a Jumper
-
Cat has-a Animal
-
Beagle has-a Tail
Answer: A,D,G
Question No: 9 – (Topic 1)
Given:
-
public static void main(String[] args) {
-
Object obj = new int[] { 1, 2, 3 };
-
int[] someArray = (int[])obj;
-
for (int i : someArray) System.out.print(i quot; quot;);
15. }
What is the result?
-
Compilation fails because of an error in line 13.
-
A ClassCastException is thrown at runtime.
C. 1 2 3
-
Compilation fails because of an error in line 14.
-
Compilation fails because of an error in line 12.
Answer: C
Question No: 10 – (Topic 1)
Given:
-
class Line {
-
public static class Point {}
12. } 13.
-
class Triangle {
-
// insert code here
16. }
Which code, inserted at line 15, creates an instance of the Point class defined in Line?
-
Line l = new Line() ; l.Point p = new l.Point();
-
Line.Point p = new Line.Point();
-
The Point class cannot be instatiated at line 15.
-
Point p = new Point();
Answer: B
100% Ensurepass Free Download!
–Download Free Demo:1z0-853 Demo PDF
100% Ensurepass Free Guaranteed!
–1z0-853 Dumps
EnsurePass | ExamCollection | Testking | |
---|---|---|---|
Lowest Price Guarantee | Yes | No | No |
Up-to-Dated | Yes | No | No |
Real Questions | Yes | No | No |
Explanation | Yes | No | No |
PDF VCE | Yes | No | No |
Free VCE Simulator | Yes | No | No |
Instant Download | Yes | No | No |
100-105 Dumps VCE PDF
200-105 Dumps VCE PDF
300-101 Dumps VCE PDF
300-115 Dumps VCE PDF
300-135 Dumps VCE PDF
300-320 Dumps VCE PDF
400-101 Dumps VCE PDF
640-911 Dumps VCE PDF
640-916 Dumps VCE PDF
70-410 Dumps VCE PDF
70-411 Dumps VCE PDF
70-412 Dumps VCE PDF
70-413 Dumps VCE PDF
70-414 Dumps VCE PDF
70-417 Dumps VCE PDF
70-461 Dumps VCE PDF
70-462 Dumps VCE PDF
70-463 Dumps VCE PDF
70-464 Dumps VCE PDF
70-465 Dumps VCE PDF
70-480 Dumps VCE PDF
70-483 Dumps VCE PDF
70-486 Dumps VCE PDF
70-487 Dumps VCE PDF
220-901 Dumps VCE PDF
220-902 Dumps VCE PDF
N10-006 Dumps VCE PDF
SY0-401 Dumps VCE PDF