[Free] 2017(Jan) EnsurePass Passguide Oracle 1z0-808 Dumps with VCE and PDF Download 121-130

Ensurepass.com : Ensure you pass the IT Exams 2017 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: 121

Which two items can legally be contained within a java class declaration?

  1. An import statement

  2. A field declaration

  3. A package declaration

  4. A method declaration

Answer: B,D

Reference: http://docs.oracle.com/javase/tutorial/java/javaOO/methods.html

Question No: 122

Given the fragment:

String[][] arra = new String[3][]; arra[0] = new String[]{quot;rosequot;, quot;lilyquot;};

arra[1] = new String[]{quot;applequot;, quot;berryquot;,quot;cherryquot;,quot;grapesquot;};

arra[0] = new String[]{quot;beansquot;, quot;carrotquot;,quot;potatoquot;};

// insert code fragment here

Which code fragment when inserted at line #39;// insert code fragment here#39;, enables the code to successfully change arra elements to uppercase?

  1. String[][] arra = new String[3][]; arra[0] = new String[]{quot;rosequot;, quot;lilyquot;};

    arra[1] = new String[]{quot;applequot;, quot;berryquot;,quot;cherryquot;,quot;grapesquot;};

    arra[0] = new String[]{quot;beansquot;, quot;carrotquot;,quot;potatoquot;}; for (int i = 0; i lt; arra.length; i ) {

    for (int j=0; j lt; arra[i].length; j ) { arra[i][j] = arra[i][j].toUpperCase();

    }

    }

  2. for (int i = 0; i lt; 3; i ) { for (int j=0; j lt; 4; j ) {

    arra[i][j] = arra[i][j].toUpperCase();

    }

    }

  3. for (String a[]:arra[][]) { for (String x:a[]) {

  4. toUpperCase();

    }

    }

  5. for (int i:arra.length) { for (String x:arra) { arra[i].toUpperCase();

}

}

Answer: C Explanation: Incorrect:

not A: arra.length is 3, but the subarrays have 2, 3 and 4 elements. Index will be out of bound.

not B: The subarrys are of different lengths. Index will be out of bound. not D: Compile error.

Question No: 123

Which code fragment cause a compilation error?

  1. flat flt = 100F;

  2. float flt = (float) 1_11.00;

  3. float flt = 100;

  4. double y1 = 203.22; floatflt = y1

  5. int y2 = 100; floatflt = (float) y2;

Answer: B

Question No: 124

Which statement is/are true?

  1. Default constructor only contains quot;super();quot; call.

  2. We can#39;t use any access modifier with a constructor.

  3. A constructor should not have a return type.

  1. Only I.

  2. Only II.

  3. Only I and II.

  4. Only I and III.

  5. AIL

Answer: D Explanation:

Statement I is correct as the default constructor only contains super0 call Statement II is incorrect as we can use any access modifier with a constructor. Statement III is correct as constructor can#39;t have return type, even void.

So option D is correct. httpsy/docs.oracle.com/javase/tutorial/iava/javaOO/construaors.html

Question No: 125

Given:

Ensurepass 2017 PDF and VCE

How many MarkList instances are created in memory at runtime?

  1. 1

  2. 2

  3. 3

  4. 4

Answer: A

Question No: 126

Given:

Ensurepass 2017 PDF and VCE

What is the result?

  1. The sum is 2

  2. The sum is 14

  3. The sum is 15

  4. The loop executes infinite times

  5. Compilation fails

Answer: E

Question No: 127

Which three are advantages of the Java exception mechanism?

  1. Improves the program structure because the error handling code is separated from the normal program function

  2. Provides a set of standard exceptions that covers all the possible errors

  3. Improves the program structure because the programmer can choose where to handle exceptions

  4. Improves the program structure because exceptions must be handled in the method in which they occurred

  5. Allows the creation of new exceptions that are tailored to the particular program being created

Answer: A,C,E

Question No: 128

Given the code fragment:

int b = 3;

if ( !(b gt; 3)) {

System.out.println(quot;square quot;);

}{

System.out.println(quot;circle quot;);

}

System.out.println(quot;…quot;); What is the result?

  1. square…

  2. circle…

  3. squarecircle…

  4. Compilation fails.

Answer: C

Question No: 129

Given the code fragment:

Ensurepass 2017 PDF and VCE

Which two modifications, when made independently, enable the code to print joe:true: 100.0?

Ensurepass 2017 PDF and VCE

  1. Option A

  2. Option B

  3. Option C

  4. Option D

  5. Option E

Answer: A,C

Question No: 130

Which of the following can fill in the blank in this code to make it compile? (Select 2 options.)

Ensurepass 2017 PDF and VCE

  1. On line 1, fill in throws

  2. On line 1, fill in throws new

  3. On line 2, fill in throw new

  4. On line 2, fill in throws

  5. On line 2, fill in throws new

Answer: A,C Explanation:

Option A and C are the correct answer.

In a method declaration, the keyword throws is used. So here at line 1 we have to use option A.

To actually throw an exception, the keyword throw is used and a new exception is created, so at line 2 we have to use throw and new keywords, which is option C. Finally it will look like;

public void method() throws Exception { throw new Exception0;

}

REFERENCE : httpsy/docs.oracle.com/javase/tutorial/essential/io/fileOps.html#exception The correct answer is: On line 1, fill in throws. On line 2, fill in throw new

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

2017 EnsurePass IT Certification PDF and VCE

Add a Comment

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

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