[Free] 2018(Jan) EnsurePass Testinsides Oracle 1z0-808 Dumps with VCE and PDF 81-90

By | January 25, 2018

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

Java SE 8 Programmer I

Question No: 81

You are asked to develop a program for a shopping application, and you are given the following information:

->The application must contain the classes Toy, EduToy, and consToy. The Toy class is the superclass of the other two classes.

->The int caicuiatePrice (Toy t) method calculates the price of a toy.

->The void printToy (Toy t) method prints the details of a toy.

Which definition of the Toy class adds a valid layer of abstraction to the class hierarchy?

Ensurepass 2018 PDF and VCE

  1. Option A

  2. Option B

  3. Option C

  4. Option D

Answer: A

Question No: 82

Given:

Ensurepass 2018 PDF and VCE

What is the result?

  1. Base DerivedA

  2. Base DerivedB

  3. DerivedB DerivedB

  4. DerivedB DerivedA

  5. A classcast Except ion is thrown at runtime.

Answer: C

Question No: 83

Given:

class Base {

public static void main(String[] args) { System.out.println(quot;Base quot; args[2]);

}

}

public class Sub extends Base{

public static void main(String[] args) { System.out.println(quot;Overriden quot; args[1]);

}

}

And the commands: javac Sub.java

java Sub 10 20 30 What is the result?

  1. Base 30

  2. Overridden 20

  3. Overridden 20 Base 30

  4. Base 30 Overridden 20

Answer: B

Question No: 84

Given the code fragment:

Ensurepass 2018 PDF and VCE

Which modification enables the code fragment to print TrueDone?

  1. Replace line 5 With String result = quot;truequot;; Replace line 7 with case quot;truequot;:

  2. Replace line 5 with boolean opt = l; Replace line 7 with case 1=

  3. At line 9, remove the break statement.

  4. Remove the default section.

Answer: A

Question No: 85

Given the code fragment:

public class Test {

static String[][] arr =new String[3][];

private static void doPrint() {

//insert code here

}

public static void main(String[] args) { String[] class1 = {quot;Aquot;,quot;Bquot;,quot;Cquot;};

String[] class2 = {quot;Lquot;,quot;Mquot;,quot;Nquot;,quot;Oquot;}; String[] class3 = {quot;Iquot;,quot;Jquot;};

arr[0] = class1; arr[1] = class2; arr[2] = class3; Test.doPrint();

}

}

Which code fragment, when inserted at line //insert code here, enables the code to print COJ?

  1. int i = 0;

    for (String[] sub: arr) { int j = sub.length -1; for (String str: sub) {

    System.out.println(str[j]); i ;

    }

    }

  2. private static void doPrint() { for (int i = 0;i lt; arr.length;i ) { int j = arr[i].length-1; System.out.print(arr[i][j]);

    }

    }

  3. int i = 0;

    for (String[] sub: arr[][]) { int j = sub.length; System.out.print(arr[i][j]); i ;

    }

  4. for (int i = 0;i lt; arr.length-1;i ) { int j = arr[i].length-1; System.out.print(arr[i][j]);

i ;

}

Answer: B Explanation: Incorrect:

not A: The following line causes a compile error: System.out.println(str[j]);

Not C: Compile erro line: for (String[] sub: arr[][]) not D: Output: C

Question No: 86

Given:

Ensurepass 2018 PDF and VCE

What is the result?

  1. myStr: 9009, myNum: 9009

  2. myStr: 7007, myNum: 7007

  3. myStr: 7007, myNum: 9009

  4. Compilation fails

Answer: C

Question No: 87

Class StaticField { static int i = 7;

public static void main(String[] args) { StaticFied obj = new StaticField(); obj.i ;

StaticField.i ; obj.i ;

System.out.println(StaticField.i quot; quot; obj.i);

}

}

What is the result?

A. 10 10

  1. 8 9

  2. 9 8

D. 7 10

Answer: A

Question No: 88

Given:

Ensurepass 2018 PDF and VCE

And the commands: Javac Test.java Java Test 12345

What is the result?

  1. Number us : 12345

  2. A NullPointerException is thrown at runtime

  3. A NumberFormatException is thrown at runtime

  4. AnArrayIndexOutOfBoundException is thrown at runtime.

Answer: A

Question No: 89

Given:

class Sports { int num_players;

String name, ground_condition;

Sports(int np, String sname, String sground){ num_players = np;

name = sname; ground_condition = sground;

}

}

class Cricket extends Sports { int num_umpires;

int num_substitutes;

Which code fragment can be inserted at line //insert code here to enable the code to compile?

  1. Cricket() {

    super(11, quot;Cricketquot;, quot;Condidtion OKquot;); num_umpires =3; num_substitutes=2;

    }

  2. Cricket() {

    super.ground_condition = quot;Condition OKquot;; super.name=quot;Cricketquot;; super.num_players = 11;

    num_umpires =3; num_substitutes=2;

    }

  3. Cricket() { this(3,2);

    super(11, quot;Cricketquot;, quot;Condidtion OKquot;);

    }

    Cricket(int nu, ns) { this.num_umpires =nu; this.num_substitutes=ns;

    }

  4. Cricket() { this.num_umpires =3; this.num_substitutes=2;

super(11, quot;Cricketquot;, quot;Condidtion OKquot;);

}

Answer: A Explanation: Incorrect:

not C, not D: call to super must be the first statement in constructor.

Question No: 90

Given:

Ensurepass 2018 PDF and VCE

A. ns = 50 S = 125 ns = 125 S = 125

ns = 100 S = 125 B. ns = 50 S = 125 ns = 125 S = 125

ns = 0 S = 125

C. ns = 50 S = 50 ns = 125 S = 125

ns = 100 S = 100 D. ns = 50 S = 50 ns = 125 S = 125

ns = 0 S = 125

Answer: B

100% Ensurepass Free Download!
Download Free Demo:1z0-808 Demo PDF
100% Ensurepass Free Guaranteed!
1z0-808 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

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.