×

Special Offer! Sale of the Month | Extra 20% OFF - Ends In Coupon code: TEL20

Free Practice Oracle 1Z0-809 Exam Questions 2025

Stay ahead with 100% Free Java SE 8 Programmer II 1Z0-809 Dumps Practice Questions

Page:    1 / 94      
Total 469 Questions | Updated On: Aug 21, 2019
Add To Cart
Question 1

Given code of Test.java file: 

1. package com.udayan.ocp;

2.  

3. import java.util.Arrays;

4. import java.util.List;

5. import java.util.ListIterator;

6.  

7. public class Test {

8.     public static void main(String[] args) {

9.         List list = Arrays.asList("T", "S", "R", "I", "F");

10.         ListIterator iter = list.listIterator(2);

11.         while(iter.hasNext()) {

12.             System.out.print(iter.next());

13.         }

14.     }

15. }

What will be the result of compiling and executing Test class?


Answer: B
Question 2

What will be the result of compiling and executing class Test?

1. package com.udayan.ocp;

2.  

3. class X {

4.     class Y {

5.         private void m() {

6.             System.out.println("INNER");

7.         }

8.     }

9.     

10.     public void invokeInner() {

11.         Y obj = new Y(); //Line 9

12.         obj.m(); //Line 10

13.     }

14. }

15.  

16. public class Test {

17.     public static void main(String[] args) {

18.         new X().invokeInner();

19.     }

20. }


Answer: C
Question 3

Assume that proper import statements are available, and 'fr' is the language code for French language. 

And you have the following code snippet:

Locale [] loc = Locale.getAvailableLocales(); 

Which of the following statements will print all the supported (by the JVM) French Language Locale on to the console?

Select 2 options.


Answer: C,D
Question 4

Given:
class FuelNotAvailException extends Exception { }
class Vehicle {
 void ride() throws FuelNotAvailException { //line n1
 System.out.println(“Happy Journey!”);
 }
}
class SolarVehicle extends Vehicle {
 public void ride () throws Exception { //line n2
 super ride ();
 }
}
and the code fragment:
public static void main (String[] args) throws FuelNotAvailException, Exception
 {
 Vehicle v = new SolarVehicle ();
 v.ride();
}
Which modification enables the code fragment to print Happy Journey!?


Answer: B
Question 5

Given code of Test.java file: 

1. package com.udayan.ocp;

2.  

3. import java.time.*;

4.  

5. public class Test {

6.     public static void main(String [] args) {

7.         System.out.println(Duration.ofDays(-2));

8.     }

9. }

What will be the result of compiling and executing Test class?


Answer: D
Page:    1 / 94      
Total 469 Questions | Updated On: Aug 21, 2019
Add To Cart

© Copyrights TheExamsLab 2025. All Rights Reserved

We use cookies to ensure your best experience. So we hope you are happy to receive all cookies on the TheExamsLab.