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

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: 131

Given:

Ensurepass 2018 PDF and VCE

Which option enables the code to compile?

Ensurepass 2018 PDF and VCE

  1. Option A

  2. Option B

  3. Option C

  4. Option D

Answer: C,D

Question No: 132

Given the following four Java file definitions:

// Foo.java package facades;

public interface Foo { }

// Boo.java package facades;

public interface Boo extends Foo { }

// Woofy.java package org.domain

// line n1

public class Woofy implements Boo, Foo { }

// Test.java package.org; public class Test {

public static void main(String[] args) { Foo obj=new Woofy();

Which set modifications enable the code to compile and run?

  1. At line n1, Insert: import facades;At line n2, insert:import facades;import org.domain;

  2. At line n1, Insert: import facades.*;At line n2, insert:import facades;import org.*;

  3. At line n1, Insert: import facades.*;At line n2, insert:import facades.Boo;import org.*;

  4. At line n1, Insert: import facades.Foo, Boo;At line n2, insert:import org.domain.Woofy;

  5. At line n1, Insert: import facades.*;At line n2, insert:import facades;import org.domain.Woofy;

Answer: E

Question No: 133

Given:

Ensurepass 2018 PDF and VCE

What is the result?

  1. True false

  2. True null

  3. Compilation fails

  4. A NullPointerException is thrown at runtime

Answer: A

Question No: 134

Given:

public class SampleClass {

public static void main(String[] args) {

AnotherSampleClass asc = new AnotherSampleClass(); SampleClass sc = new SampleClass();

sc = asc;

System.out.println(quot;sc: quot; sc.getClass());

System.out.println(quot;asc: quot; asc.getClass());

}}

class AnotherSampleClass extends SampleClass {

}

What is the result?

  1. sc: class Object

    asc: class AnotherSampleClass

  2. sc: class SampleClass

    asc: class AnotherSampleClass

  3. sc: class AnotherSampleClass asc: class SampleClass

  4. sc: class AnotherSampleClass asc: class AnotherSampleClass

Answer: D

Question No: 135

Given:

public class MainMethod { void main() { System.out.println(quot;onequot;);

}

static void main(String args) { System.out.println(quot;twoquot;);

}

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

}

void mina(Object[] args) { System.out.println(quot;fourquot;);

}

}

What is printed out when the program is excuted?

  1. one

  2. two

  3. three

  4. four

Answer: C

Question No: 136

boolean log3 = ( 5.0 != 6.0) amp;amp; ( 4 != 5);

boolean log4 = (4 != 4) || (4 == 4); System.out.println(quot;log3:quot; log3 \nlog4quot; log4);

What is the result?

  1. log3:false log4:true

  2. log3:true log4:true

  3. log3:true log4:false

  4. log3:false log4:false

Answer: B

Question No: 137

Given:

class MarksOutOfBoundsException extends IndexOutOfBoundsException { } public class GradingProcess {

void verify(int marks) throws IndexOutOfBoundsException { if (marks gt; 100) {

throw new MarksOutOfBoundsException();

}

if (marks gt; 50) { System.out.print(quot;Passquot;);

} else { System.out.print(quot;Failquot;);

}

}

public static void main(String[] args) { int marks = Integer.parseInt(args[2]); try {

new GradingProcess().verify(marks));

} catch(Exception e) { System.out.print(e.getClass());

}

}

}

And the command line invocation: Java grading process 89 50 104

What is the result?

  1. Pass

  2. Fail

  3. Class MarketOutOfBoundsException

  4. Class IndexOutOfBoundsException

  5. Class Exception

Answer: C

Explanation: The value 104 will cause a MarketOutOfBoundsException

Question No: 138

Given the code fragment:

Ensurepass 2018 PDF and VCE

What is the result?

A. 2 4

B. 0 2 4 6

C. 0 2 4

D. Compilation fails

Answer: C

Question No: 139

Given:

Ensurepass 2018 PDF and VCE

What is the result?

A. 120

  1. 120D

  2. A NumberFormatException will be thrown.

  3. Compilation fails due to error at line 5.

  4. Compilation tails due to error at line 8.

Answer: E Explanation:

At line 5, we have created a wrapper object of double by passing 120D, which is convertible to a Double, so there won#39;t be any exception there. But if you check carefully, you can see the variable number is declared inside try block, so the scope of the variable number is limited to that block, so trying to access it outside causes a compile time error. httpsy/docs.oracle.com/javase/tutorial/iava/nutsandbolts/variables.html

Question No: 140

Given:

public class Test {

public static void main(String[] args) { int arr[] = new int[4];

arr[0] = 1;

arr[1] = 2;

arr[2] = 4;

arr[3] = 5; int sum = 0; try {

for (int pos = 0; pos lt;= 4; pos ) { sum = sum arr[pos];

}

} catch (Exception e) { System.out.println(quot;Invalid indexquot;);

}

System.out.println(sum);

}

}

What is the result?

  1. 12

  2. Invalid Index 12

  3. Invalid Index

  4. Compilation fails

    Answer: B

    Explanation: The loop ( for (int pos = 0; pos lt;= 4; pos ) { ), it should be pos lt;= 3, causes an exception, which is caught. Then the correct sum is printed.

    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.