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

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

Given the code fragment:

Ensurepass 2018 PDF and VCE

And given the requirements:

->If the value of the qty variable is greater than or equal to 90, discount = 0.5

->If the value of the qty variable is between 80 and 90, discount = 0.2

Which two code fragments can be independently placed at line n1 to meet the requirements?

Ensurepass 2018 PDF and VCE

  1. Option A

  2. Option B

  3. Option C

  4. Option D

  5. Option E

Answer: A,C

Question No: 72

Which of the following will print current time?

  1. System.out.print(new LocalTime()-now0);

  2. System.out.print(new LocalTime());

  3. System.ouLprint(LocalTime.now());

  4. System.ouLprint(LocalTime.today());

  5. None of the above.

Answer: C Explanation:

The LocalTime is an interface, so we can#39;t use new keyword with them. So options A and C are incorrect.

To get current time we can call now method on LocalTime interface. So option C is correct. Option D is incorrect as there is no method called today as in LocalTime interface https://docs.oracle.com/javase/tutorial/datetime/iso/datetime.html

Question No: 73

Given the following class declarations:

->public abstract class Animal

->public interface Hunter

->public class Cat extends Animal implements Hunter

->public class Tiger extends Cat

Which answer fails to compile?

Ensurepass 2018 PDF and VCE

  1. Option A

  2. Option B

  3. Option C

  4. Option D

  5. Option E

Answer: E

Explanation: Look at the right side of the declaration ArrayLIst() rather than ArrayList

Question No: 74

Given:

Ensurepass 2018 PDF and VCE

The class is poorly encapsulated. You need to change the circle class to compute and return the area instead.

Which two modifications are necessary to ensure that the class is being properly encapsulated?

  1. Remove the area field.

  2. Change the getArea( ) method as follows:

    public double getArea ( ) { return Match.PI * radius * radius; }

  3. Add the following method:

    public double getArea ( ) {area = Match.PI * radius * radius; }

  4. Change the cacess modifier of the SerRadius ( ) method to be protected.

Answer: B,D

Question No: 75

Given the code in a file Traveler.java:

Ensurepass 2018 PDF and VCE

And the commands: Javac Traveler.java

Java Traveler Java Duke What is the result?

  1. Happy Journey! Duke

  2. Happy Journey! Java

  3. An exception is thrown at runtime

  4. The program fails to execute due to a runtime error

Answer: D

Question No: 76

Given:

Ensurepass 2018 PDF and VCE

How many objects have been created when the line / / do complex stuff is reached?

  1. Two

  2. Three

  3. Four

  4. Six

Answer: C

Question No: 77

Given:

public class TestLoop1 {

public static void main(String[] args) { int a = 0, z=10;

while (a lt; z) {

a ;

-z;

}

System.out.print(a quot; : quot; z);

}

}

What is the result?

A. 5 : 5

B. 6 : 4

C. 6 : 5

D. 5 : 4

Answer: A

Question No: 78

Which two are benefits of polymorphism?

  1. Faster code at runtime

  2. More efficient code at runtime

  3. More dynamic code at runtime

  4. More flexible and reusable code

  5. Code that is protected from extension by other classes

Answer: C,D

Question No: 79

Given: Given:

public class SuperTest {

public static void main(String[] args) { statement1

statement2 statement3

}

}

class Shape { public Shape() {

System.out.println(quot;Shape: constructorquot;);

}

public void foo() { System.out.println(quot;Shape: fooquot;);

}

}

class Square extends Shape { public Square() {

super();

}

public Square(String label) { System.out.println(quot;Square: constructorquot;);

}

public void foo() { super.foo();

}

public void foo(String label) { System.out.println(quot;Square: fooquot;);

}

}

}

}

What should statement1, statement2, and statement3, be respectively, in order to produce the result?

Shape: constructor Square: foo Shape: foo

  1. Square square = new Square (quot;barquot;); square.foo (quot;barquot;);

    square.foo();

  2. Square square = new Square (quot;barquot;); square.foo (quot;barquot;);

    square.foo (quot;barquot;);

  3. Square square = new Square (); square.foo ();

    square.foo(bar);

  4. Square square = new Square (); square.foo ();

    square.foo(quot;barquot;);

  5. Square square = new Square (); square.foo ();

    square.foo ();

  6. Square square = new Square(); square.foo(quot;barquot;);

square.foo();

Answer: F

Question No: 80

Given the code fragment:

Ensurepass 2018 PDF and VCE

What is the result?

  1. A B C Work done

  2. A B C D Work done

  3. A Work done

  4. Compilation fails

Answer: C

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.