Your success in Oracle 1Z0-809 is our sole target and we develop all our 1Z0-809 braindumps in a way that facilitates the attainment of this target. Not only is our 1Z0-809 study material the best you can find, it is also the most detailed and the most updated. 1Z0-809 Practice Exams for Oracle Java 1Z0-809 are written to the highest standards of technical accuracy.

Q25. Which two reasons should you use interfaces instead of abstract classes? 

A. You expect that classes that implement your interfaces have many common methods or fields, or require access modifiers other than public. 

B. You expect that unrelated classes would implement your interfaces. 

C. You want to share code among several closely related classes. 

D. You want to declare non-static on non-final fields. 

E. You want to take advantage of multiple inheritance of type. 

Answer: A,E 

Reference: http://www.programmerinterview.com/index.php/java-questions/interface-vs-abstract-class/ 


Q26. Given: 

Which two classes use the shape class correctly? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

E. Option E 

F. Option F 

Answer: B,E 

Explanation: When an abstract class is subclassed, the subclass usually provides implementations for all of the abstract methods in its parent class (E). However, if it does not, then the subclass must also be declared abstract (B). Note: An abstract class is a class that is declared abstract—it may or may not include abstract methods. Abstract classes cannot be instantiated, but they can be subclassed. 


Q27. Given the code fragment: 

List<String> nL = Arrays.asList(“Jim”, “John”, “Jeff”); 

Function<String, String> funVal = s -> “Hello : “.contact(s); 

nL.Stream() 

.map(funVal) 

.peek(System.out::print); 

What is the result? 

A. Hello : Jim Hello : John Hello : Jeff 

B. Jim John Jeff 

C. The program prints nothing. 

D. A compilation error occurs. 

Answer:


Q28. Given: 

What is the result? 

A. 6 7 8 

B. 7 8 9 

C. 0 1 2 

D. 6 8 10 

E. Compilation fails 

Answer:


Q29. Given the code fragments: 

What is the result? 

A. Super Sub Sub 

B. Contract Contract Super 

C. Compilation fails at line n1 

D. Compilation fails at line n2 

Answer:


Q30. Given the code fragment: 

Path source = Paths.get (“/data/december/log.txt”); 

Path destination = Paths.get(“/data”); 

Files.copy (source, destination); 

and assuming that the file /data/december/log.txt is accessible and contains: 

10-Dec-2014 – Executed successfully 

What is the result? 

A. A file with the name log.txt is created in the /data directory and the content of the /data/december/log.txt file is copied to it. 

B. The program executes successfully and does NOT change the file system. 

C. A FileNotFoundException is thrown at run time. 

D. A FileAlreadyExistsException is thrown at run time. 

Answer:


Q31. Which two statements are true about localizing an application? 

A. Support for new regional languages does not require recompilation of the code. 

B. Textual elements (messages and GUI labels) are hard-coded in the code. 

C. Language and region-specific programs are created using localized data. 

D. Resource bundle files include data and currency information. 

E. Language codes use lowercase letters and region codes use uppercase letters. 

Answer: A,E 

Reference: http://docs.oracle.com/javase/7/docs/technotes/guides/intl/ 


Q32. Given the code fragment: 

public class Foo { 

public static void main (String [ ] args) { 

Map<Integer, String> unsortMap = new HashMap< > ( ); 

unsortMap.put (10, “z”); 

unsortMap.put (5, “b”); 

unsortMap.put (1, “d”); 

unsortMap.put (7, “e”); 

unsortMap.put (50, “j”); 

Map<Integer, String> treeMap = new TreeMap <Integer, String> (new 

Comparator<Integer> ( ) { 

@Override public int compare (Integer o1, Integer o2) {return o2.compareTo 

(o1); } } ); 

treeMap.putAll (unsortMap); 

for (Map.Entry<Integer, String> entry : treeMap.entrySet () ) { 

System.out.print (entry.getValue () + “ “); 

What is the result? 

A. A compilation error occurs. 

B. d b e z j 

C. j z e b d 

D. z b d e j 

Answer: