Free Oracle 1Z0-809 Exam Questions

Become Oracle Certified with updated 1Z0-809 exam questions and correct answers

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

Consider the code of Test.java file:

1. package com.udayan.ocp;

2.  

3. class Player {

4.     String name;

5.     int age;

6.  

7.     Player() {

8.         this.name = "Yuvraj";

9.         this.age = 36;

10.     }

11.  

12.     public String toString() {

13.         return name + ", " + age;

14.     }

15.     

16.     public Class getClass() { 

17.         return super.getClass();

18.     }

19. }

20.  

21. public class Test {

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

23.         System.out.println(new Player());

24.     }

25. }

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


Answer: A
Question 2

Given structure of EMPLOYEE table: 

EMPLOYEE (ID integer, FIRSTNAME varchar(100), LASTNAME varchar(100), SALARY real, PRIMARY KEY (ID)) 

EMPLOYEE table contains below records: 

1. 101 John Smith 12000

2. 102 Sean Smith 15000

3. 103 Regina Williams 15500

4. 104 Natasha George 14600

Given code of Test.java file: 

1. package com.udayan.ocp;

2.  

3. import java.sql.*;

4. import java.util.Properties;

5.  

6. public class Test {

7.     public static void main(String[] args) throws Exception {

8.         String url = "jdbc:mysql://localhost:3306/ocp";

9.         Properties prop = new Properties();

10.         prop.put("user", "root");

11.         prop.put("password", "password");

12.         String query = "Select ID, FIRSTNAME, LASTNAME, SALARY FROM EMPLOYEE ORDER BY ID";

13.         try (Connection con = DriverManager.getConnection(url, prop);

14.              Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);

15.              ResultSet rs = stmt.executeQuery(query);)

16.         {

17.             rs.afterLast();

18.             rs.relative(-1);

19.             rs.previous();

20.             System.out.println(rs.getInt(1));

21.         }

22.     }

23. }

Also assume: 

URL, username and password are correct.

SQL query is correct and valid.

The JDBC 4.2 driver jar is configured in the classpath.

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


Answer: A
Question 3

Given code of Test.java file: 

1. package com.udayan.ocp;

2.  

3. import java.util.stream.Stream;

4.  

5. public class Test {

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

7.         System.out.println(Stream.of(10, 0, -10).sorted().findAny().orElse(-1));

8.     }

9. }

Which of the following statements are true about the execution of Test class?

Select 2 options.


Answer: A,B
Question 4

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 5

Given:

Untitled1-page69-image37
and the code fragment:
Untitled1-page69-image36
Which two code fragments, when inserted at line n1 independently, enable the code to print
TruckCarBike?


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

© Copyrights DumpsCertify 2025. All Rights Reserved

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