The Secret of 1Z0-804 exams

Master the 1Z0-804 Java SE 7 Programmer II Exam content and be ready for exam day success quickly with this Testking 1Z0-804 torrent. We guarantee it!We make it a reality and give you real 1Z0-804 questions in our Oracle 1Z0-804 braindumps.Latest 100% VALID Oracle 1Z0-804 Exam Questions Dumps at below page. You can use our Oracle 1Z0-804 braindumps and pass your exam.

♥♥ 2021 NEW RECOMMEND ♥♥

Free VCE & PDF File for Oracle 1Z0-804 Real Exam (Full Version!)

★ Pass on Your First TRY ★ 100% Money Back Guarantee ★ Realistic Practice Exam Questions

Free Instant Download NEW 1Z0-804 Exam Dumps (PDF & VCE):
Available on:

Q21. Which four are syntactically correct? 

A. package abc; package def; import Java.util . * ; public class Test { } 

B. package abc; import Java.util.*; import Java.util.regex.* ; public class Test { } 

C. package abc; public class Test {} import Java.util.* ; 

D. import Java.util.*; package abc; public class Test {} 

E. package abc; import java.util. *; public class Test{} 

F. public class Test{} package abc; import java.util.*{} 

G. import java.util.*; public class Test{} 

H. package abc; public class test {} 

Answer: B,E,G,H 

Q22. Which two actions can be used in registering a JDBC 3.0 driver? 

A. Add the driver class to the META-INF/services folder of the JAR file. 

B. Set the driver class name by using the jdbc.drivers system property. 

C. Include the JDBC driver class in a jdbcproperties file. 

D. Use the java.lang.class.forName method to load the driver class. 

E. Use the DriverManager.getDriver method to load the driver class. 

Answer: A,D 


A: if your JDBC Driver is NOT JDBC 4-compliant then we can update the driver using "jar"-utility by adding the "META-INF /services/java.sql.Driver" inside it. as following: D:Dynamic loading of Java classes at runtime provides tremendous flexibility in the development of enterprisesystems. It provides for the basis of "application servers", and allows even simpler, lighter-weight systems toaccomplish some of the same ends. Within Java, dynamic-loading is typically achieved by calling the forNamemethod on the class java.lang.ClassAn example provided by the standard Java SE API is the ServiceLoader. Amongothers, the JDBC 4.0compatible drivers implement this. This way just dropping the JDBC driver JAR file folder will automatically loadthe driver class during Java application's startup/initialization without the need for any manual Class.forName("com.example.Driver") line in your code. 

Q23. Given that myfile.txt contains: 

What is the result? 

A. new file.txt contains: 

1: First 

2: Second 




new file.txt contains: 


 First 2: Second 3: Third 


newfile.txt is empty 


an exception is thrown at runtime 


compilation fails 



For each line in the file myfile.text the line number and the line is written into newfile.txt. 

Q24. Which three statements are correct about thread's sleep method? 

A. The sleep (long) method parameter defines a delay in milliseconds. 

B. The sloop (long) method parameter defines a delay in microseconds. 

C. A thread is guaranteed to continue execution after the exact amount of time defined in the sleep (long)parameter. 

D. A thread can continue execution before the amount of time defined in the sleep (long) parameter. 

E. A thread can continue execution after the amount of time defined in the sleep (long) parameter 

F. Only runtime exceptions are thrown by the sleep method. 

G. A thread loses all object monitors (lock flags) when calling the sleep method. 

Answer: A,C,E 


sleep (long millis) not B Causes the currently executing thread to sleep (temporarily cease execution) for the specified number ofmilliseconds(A, not B) millis - the length of time to sleep in milliseconds. throws InterruptedException: - if another thread has interrupted the current thread. The interrupted status ofthe current thread is cleared when this exception is thrown. java.lang.Throwable java.lang.Exception java.lang.InterruptedException The thread does not lose ownership of any monitors. It means that if the thread has an object-monitor, all otherthreads that need that monitor are blocked. This method can be called regardless whether the thread has any monitor or not. 

Q25. ITEM Table 





And given the code fragment (assuming that the SQL query is valid): 

What is the result of compiling and executing this code? 

A. An exception is thrown at runtime 

B. Compile fails 

C. The code prints Error 

D. The code prints information about Item 110 




Compiles successfully ! Not B ! 

D is correct, if Column Quantity instead of Quality 

Table Item Column Quality --- System.out.println("Quantity: " + rs.getInt("Quantity")); 

wenn jedoch so gewollt: die Zeile gibt Error aus (die anderen funktionieren) !!! 

The connection conn is not defined. The code will not compile. 

Q26. The two methods of code reuse that aggregate the features located in multiple classes are ____________ ? 

A. Inheritance 

B. Copy and Paste 

C. Composition 

D. Refactoring 

E. Virtual Method Invocation 

Answer: A,C 


A: Inheritance is a way of reusing code and building bigger more functional objects from a 

basic object. 

The original little object, the parent, is called the super-class. The more functional object 

that inherits from it iscalled the sub-class . 

C: When your goal is code reuse, composition provides an approach that yields easier-to-change code. 

Q27. Given the code fragment: 

Why is there no output when otherMethod is called? 

A. An exception other than IOException is thrown. 

B. Standard error is not mapped to the console. 

C. There is a compilation error. 

D. The exception is suppressed. 



C: wenn printStackTrace() ohne Referenz auf das Exception object aufgerufen 

A : wenn e.printStackTrace(); 

The code compiles fine 

The line 

FileInputStream fis = new FileInputStream(file)) 

will fail at runtime since file is an empty string. 


public void printStackTrace() 

Prints this throwable and its backtrace to the standard error stream. 

Q28. Given: 

What is the result? 

A. 5 

B. 6 

C. An exception is thrown at runtime 

D. Compilation fails due to an error on line 6 

E. Compilation fails due to an error on line 7 



The code compile fine but java.lang.NullPointerException is thrown at runtime. 

x has no value. The code would run if line 2 was changed to: 

Integer x = 3; 

Q29. Given: 

What is the result? 

A. Pastel Enamel Fresco Gouache B. Pastel *Enamel Fresco *Gouache 

C. Pastel Enamel Fresco Gouache 

D. Pastel Enamel, Fresco Gouache 



regex explanation: 

, = , 

\ = masks the following 

\s = A whitespace character: [ \t \n \x0B \f \r ] 

* = Greedy Quantifier: zero or more times Delimiter: comma + zero or more whitespace characters 

Q30. Given: 

Which statement will iterate through Direction? 

A. for (Direction d : Direction.values()){ // 

B. for (Direction d : Direction.asList()){ 


C. for (Direction d : Direction.iterator()){ 


D. for (Direction d : Direction.asArray()){ 




The static values() method of an enum type returns an array of the enum values. The 

foreach loop is a good 

way to go over all of them. 

//... Loop over all values. 

for (Direction d : Direction.values()){ 

System.out.println(d); // PrintsNORTH, EAST, ...