By simply building an Oracle one turn out to be anywhere near this much closer obtain any sort of near future job occasion or advancement within your specialist lifetime. 1Z0-852 qualification is granted should the customer passes by some sort of computerised evaluation going down inside a protected setting. Any Oracle 1Z0-852courses frequently has a in depth lessons material protecting almost all the simple and easy leading-edge material in the troubled Oracle merchandise.

2016 Sep 1Z0-852 practice exam

Q1. Given: 

11.

 String test = "Test A. Test B. Test C."; 

12.

 // insert code here 

13.

 String[] result = test.split(regex); 

Which regular expression, inserted at line 12, correctly splits test into "Test A", "Test B", and "Test C"? 

A. String regex = ""; B. String regex = " "; C. String regex = ".*"; D. String regex = "\\s"; 

E. String regex = "\\.\\s*"; 

F. String regex = "\\w[ \.] +"; 

Answer: E 

Explanation: 

18. Given that the current directory is empty, and that the user has read and write privileges to the current directory, and the following: 

1.

 import java.io.*; 

2.

 public class Maker { 

3.

 public static void main(String[] args) { 

4.

 File dir = new File("dir"); 

5.

 File f = new File(dir, "f"); 

6.

 } 

7.

 } 

Which statement is true? 

A. Compilation fails. 

B. Nothing is added to the file system. 

C. Only a new file is created on the file system. 

D. Only a new directory is created on the file system. 

E. Both a new file and a new directory are created on the file system. 

Answer: B 

Explanation: 


Q2. A company that makes Computer Assisted Design (CAD) software has, within its application, some utility classes that are used to perform 3D rendering tasks. The company's chief scientist has just improved the performance of one of the utility classes' key rendering algorithms, and has assigned a programmer to replace the old algorithm with the new algorithm. When the programmer begins researching the utility classes, she is happy to discover that the algorithm to be replaced exists in only one class. The programmer reviews that class's API, and replaces the old algorithm with the new algorithm, being careful that her changes adhere strictly to the class's API. Once testing has begun, the programmer discovers that other classes that use the class she changed are no longer working properly. What design flaw is most likely the cause of these new bugs? 

A. Inheritance 

B. Tight coupling 

C. Low cohesion 

D. High cohesion 

E. Loose coupling 

F. Object immutability 

Answer: B 

Explanation: 


Q3. Given that c is a reference to a valid java.io.Console object, which two code fragments read a line of text from the console? (Choose two.) 

A. String s = c.readLine(); 

B. char[] c = c.readLine(); 

C. String s = c.readConsole(); 

D. char[] c = c.readConsole(); 

E. String s = c.readLine("%s", "name "); 

F. char[] c = c.readLine("%s", "name "); 

Answer: A,E 

Explanation: 


Q4. Given: 

11.

 public interface A111 { 

12.

 String s = "yo"; 

13.

 public void method1(); 

14.

 } 

17. interface B { } 

20.

 interface C extends A111, B { 

21.

 public void method1(); 

22.

 public void method1(int x); 

23.

 } 

What is the result? 

A. Compilation succeeds. 

B. Compilation fails due to multiple errors. 

C. Compilation fails due to an error only on line 20. 

D. Compilation fails due to an error only on line 21. 

E. Compilation fails due to an error only on line 22. 

F. Compilation fails due to an error only on line 12. 

Answer: A 

Explanation: 


Q5. RAG DROP 

Click the Task button. 

Answer: 


certifyforall.com

Rebirth 1Z0-852 practice exam:

Q6. Given a pre-generics implementation of a method: 

11.

 public static int sum(List list) { 

12.

 int sum = 0; 

13.

 for ( Iterator iter = list.iterator(); iter.hasNext(); ) { 

14.

 int i = ((Integer)iter.next()).intValue(); 

15.

 sum += i; 

16.

 } 

17.

 return sum; 

18.

 } 

What three changes allow the class to be used with generics and avoid an unchecked warning? (Choose three.) 

A. Remove line 14. 

B. Replace line 14 with "int i = iter.next();". 

C. Replace line 13 with "for (int i : intList) {". 

D. Replace line 13 with "for (Iterator iter : intList) {". 

E. Replace the method declaration with "sum(List<int> intList)". 

F. Replace the method declaration with "sum(List<Integer> intList)". 

Answer: A,C,F 

Explanation: 

44. Given: 

12.

 import java.util.*; 

13.

 public class Explorer2 { 

14.

 public static void main(String[] args) { 

15.

 TreeSet<Integer> s = new TreeSet<Integer>(); 

16.

 TreeSet<Integer> subs = new TreeSet<Integer>(); 

17.

 for(int i = 606; i < 613; i++) 

18.

 if(i%2 == 0) s.add(i); 

19.

 subs = (TreeSet)s.subSet(608, true, 611, true); 

20.

 s.add(629); 

21.

 System.out.println(s + " " + subs); 

22.

 } 

23.

 } 

What is the result? 

A. Compilation fails. 

B. An exception is thrown at runtime. 

C. [608, 610, 612, 629] [608, 610] 

D. [608, 610, 612, 629] [608, 610, 629] 

E. [606, 608, 610, 612, 629] [608, 610] 

F. [606, 608, 610, 612, 629] [608, 610, 629] 

Answer: E 

Explanation: 


Q7. A developer is creating a class Book, that needs to access class Paper. The Paper class is deployed in a JAR named myLib.jar. Which three, taken independently, will allow the developer to use the Paper class while compiling the Book class? (Choose three.) 

A. The JAR file is located at $JAVA_HOME/jre/classes/myLib.jar. 

B. The JAR file is located at $JAVA_HOME/jre/lib/ext/myLib.jar.. 

C. The JAR file is located at /foo/myLib.jar and a classpath environment variable is set that includes /foo/myLib.jar/Paper.class. 

D. The JAR file is located at /foo/myLib.jar and a classpath environment variable is set that includes /foo/myLib.jar. 

E. The JAR file is located at /foo/myLib.jar and the Book class is compiled using javac -cp /foo/myLib.jar/Paper Book.java. 

F. The JAR file is located at /foo/myLib.jar and the Book class is compiled using javac -d /foo/myLib.jar Book.java 

G. The JAR file is located at /foo/myLib.jar and the Book class is compiled using javac -classpath /foo/myLib.jar Book.java 

Answer: B,D,G 

Explanation: 


Q8. Given: 

5.

 import java.util.*; 

6.

 public class SortOf { 

7.

 public static void main(String[] args) { 

8.

 ArrayList<Integer> a = new ArrayList<Integer>(); 

9.

 a.add(1); a.add(5); a.add(3); 

11.

 Collections.sort(a); 

12.

 a.add(2); 

13.

 Collections.reverse(a); 

14.

 System.out.println(a); 

15.

 } 

16.

 } 

What is the result? 

A. [1, 2, 3, 5] 

B. [2, 1, 3, 5] 

C. [2, 5, 3, 1] 

D. [5, 3, 2, 1] 

E. [1, 3, 5, 2] 

F. Compilation fails. 

G. An exception is thrown at runtime. 

Answer: C 

Explanation: 


Q9. Given: 

11.

 public static void main(String[] args) { 

12.

 String str = "null"; 

13.

 if (str == null) { 

14.

 System.out.println("null"); 

15.

 } else (str.length() == 0) { 

16.

 System.out.println("zero"); 

17.

 } else { 

18.

 System.out.println("some"); 

19.

 } 

20.

 } 

What is the result? 

A. null B. zero C. some 

D. Compilation fails. 

E. An exception is thrown at runtime. 

Answer: D 

Explanation: 


Q10. Given: 

11.

 public static void main(String[] args) { 

12.

 Integer i = new Integer(1) + new Integer(2); 

13.

 switch(i) { 

14.

 case 3: System.out.println("three"); break; 

15.

 default: System.out.println("other"); break; 

16.

 } 

17.

 } 

What is the result? 

A. three 

B. other 

C. An exception is thrown at runtime. 

D. Compilation fails because of an error on line 12. 

E. Compilation fails because of an error on line 13. 

F. Compilation fails because of an error on line 15. 

Answer: A 

Explanation: