[Free] 2018(Jan) EnsurePass Examcollection Oracle 1z0-803 Dumps with VCE and PDF 101-110

Ensurepass.com : Ensure you pass the IT Exams
2018 Jan Oracle Official New Released 1z0-803
100% Free Download! 100% Pass Guaranteed!
http://www.EnsurePass.com/1z0-803.html

Java SE 7 Programmer I

Question No: 101

Given the code fragment:

public static void main(String[] args) { int iArray[] = {65, 68, 69};

iArray[2] = iArray[0]; iArray[0] = iArray[1];

iArray[1] = iArray[2];

for (int element : iArray) { System.out.print(element quot; quot;);

}

A. 68, 65, 69

B. 68, 65, 65

C. 65,68, 65

D. 65, 68, 69

E. Compilation fails

Answer: B

Question No: 102

Given the code fragment:

//insert code here arr[0] = new int[3]; arr[0][0] = 1;

arr[0][1] = 2;

arr[0][2] = 3;

arr[1] = new int[4]; arr[1][0] = 10;

arr[1][1] = 20;

arr[1][2] = 30;

arr[1][3] = 40;

Whichtwo statements, when inserted independently at line // insert code here, enable the code to compile?

  1. int [] [] arr = null;

  2. int [] [] arr = new int [2];

  3. int [] [] arr = new int [2] [ ];

  4. int [] [] arr = new int [] [4];

  5. int [] [] arr = new int [2] [0];

  6. int [] [] arr=new int [0] [4];

Answer: C,E

Question No: 103

Given:

Ensurepass 2018 PDF and VCE

What code should be inserted?

Ensurepass 2018 PDF and VCE

  1. Option A

  2. Option B

  3. Option C

  4. Option D

  5. Option E

  6. Option F

Answer: C Explanation:

Dog should be an abstract class. The correct syntax for this is: abstract class Dog { Poodle should extend Dog (not implement).

Question No: 104

Given:

Ensurepass 2018 PDF and VCE

Which statement, when inserted into line 5, is valid change?

  1. asc = sc;

  2. sc = asc;

  3. asc = (object) sc;

  4. asc = sc.clone ()

Answer: B Explanation: Works fine.

Question No: 105

Given:

public class TestOperator {

public static voidmain(String[] args) { int result = 30 -12 / (2*5) 1; System.out.print(quot;Result = quot; result);

}

}

What is the result?

  1. Result = 2

  2. Result = 3

  3. Result = 28

  4. Result = 29

  5. Result = 30

Answer: E

Question No: 106

View the exhibit:

public class Student { public String name= quot;quot;; public int age = 0;

public String major = quot;Undeclaredquot;; public boolean fulltime = true; public void display() {

System.out.println(quot;Name: quot; name quot; Major: quot; major); } public boolean isFullTime() {

return fulltime;

}

}

Which line of code initializes a student instance?

  1. Student student1;

  2. Student student1 = Student.new();

  3. Student student1 = new Student();

  4. Student student1 = Student();

Answer: C

Question No: 107

Given:

class Cake { int model; String flavor; Cake() { model = 0;

flavor = quot;Unknownquot;;

}

}

public class Test {

public static void main(String[] args) { Cake c = new Cake();

bake1(c);

System.out.println(c.model quot; quot; c.flavor);

bake2(c);

System.out.println(c.model quot; quot; c.flavor);

}

public static Cake bake1(Cake c) { c.flavor = quot;Strawberryquot;;

c.model = 1200; return c;

}

public static void bake2(Cake c) { c.flavor = quot;Chocolatequot;;

c.model = 1230; return;

}

}

What is the result?

  1. 0 unknown 0 unknown

  2. 1200 Strawberry 1200 Strawberry

  3. 1200 Strawberry 1230 Chocolate

  4. Compilation fails

Answer: C

Explanation: 1200 Strawberry

1230 Chocolate

Question No: 108

Given:

Ensurepass 2018 PDF and VCE

What is the result?

  1. There is no output

  2. d is output

  3. A StringIndexOutOfBoundsException is thrown at runtime

  4. An ArrayIndexOutOfBoundsException is thrown at runtime

  5. A NullPointException is thrown at runtime

  6. A StringArrayIndexOutOfBoundsException is thrown at runtime

Answer: C Explanation:

There are only 11 characters in the string quot;Hello Worldquot;. The code theString.charAt(11) retrieves the 12th character, which does not exist. A StringIndexOutOfBoundsException is thrown.

Exception in thread quot;mainquot; java.lang.StringIndexOutOfBoundsException: String index out of range: 11

Question No: 109

Given:

Ensurepass 2018 PDF and VCE

What is the result?

Ensurepass 2018 PDF and VCE

  1. Option A

  2. Option B

  3. Option C

  4. Option D

Answer: C

Question No: 110

Given:

public class Test {

public static void main(String[] args) {

int day = 1; switch (day) {

case quot;7quot;: System.out.print(quot;Uranusquot;);

case quot;6quot;: System.out.print(quot;Saturnquot;);

case quot;1quot;: System.out.print(quot;Mercuryquot;);

case quot;2quot;: System.out.print(quot;Venusquot;);

case quot;3quot;: System.out.print(quot;Earthquot;);

case quot;4quot;: System.out.print(quot;Marsquot;);

case quot;5quot;: System.out.print(quot;Jupiterquot;);

}

}

}

Which two modifications, made independently, enable the code to compile and run?

  1. Adding a break statement after each print statement

  2. Adding a default section within the switch code-block

  3. Changing the string literals in each case label to integer

  4. Changing the type of the variable day to String

  5. Arranging the case labels in ascending order

Answer: A,C

Explanation: The following will work fine:

public class Test {

public static void main(String[] args) { int day = 1;

switch (day) {

case 7: System.out.print(quot;Uranusquot;); break; case 6:System.out.print(quot;Saturnquot;); break; case 1: System.out.print(quot;Mercuryquot;); break; case 2: System.out.print(quot;Venusquot;); break; case 3: System.out.print(quot;Earthquot;); break; case 4: System.out.print(quot;Marsquot;); break; case 5: System.out.print(quot;Jupiterquot;); break;

}

}

}

100% Ensurepass Free Download!
Download Free Demo:1z0-803 Demo PDF
100% Ensurepass Free Guaranteed!
Download 2018 EnsurePass 1z0-803 Full Exam PDF and VCE

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

Leave a Reply

Your email address will not be published. Required fields are marked *