Download Java SE 7 Programmer II.1z0-804.ExamDumps.2018-06-05.149q.vcex

Vendor: Oracle
Exam Code: 1z0-804
Exam Name: Java SE 7 Programmer II
Date: Jun 05, 2018
File Size: 12 MB

How to open VCEX files?

Files with VCEX extension can be opened by ProfExam Simulator.

Demo Questions

Question 1
Given the code fragment:
 
Which two try statements, when inserted at line ***, enable you to print files with the extensions.java, .htm, and .jar.
  1. try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir,"*.{java,htm,jar}")){
  2. try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir,"*. [java,htm,jar]")) {
  3. try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir,"*.{java*,htm*,jar*}")) {
  4. try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir,"**.{java,htm,jar}")) {
Correct answer: AD
Explanation:
"*. {java,htm,jar} and"**. {java,htm,jar} will match any file with file endings java, htm, or jar.
"*. {java,htm,jar} and
"**. {java,htm,jar} will match any file with file endings java, htm, or jar.
Question 2
Which two are valid initialization statements?
  1. Map<String, String> m = new SortedMap<String, String>();
  2. Collection m = new TreeMap<Object, Object>();
  3. HashMap<Object, Object> m = new SortedMap<Object, Object>();
  4. SortedMap<Object, Object> m = new TreeMap<Object, Object> ();
  5. Hashtable m= new HashMap();
  6. Map<List, ArrayList> m = new Hashtable<List, ArrayList>();
Correct answer: DF
Question 3
Given:
 
What is the most likely result?
  1. Main One Two
  2. Main Two One
  3. One Two Main
  4. One Main Two
  5. Two Main One
Correct answer: C
Question 4
Given:
 
What is the result?
  1. riding riding tolting
  2. riding riding cantering
  3. tolting cantering tolting
  4. tolting cantering cantering
  5. Compilation fails.
  6. An exception is thrown at runtime.
Correct answer: E
Explanation:
The compilation fails at:interface Rideable {public String ride() { return "riding ";} }Error due to: interface methods cannot have body.
The compilation fails at:
interface Rideable {
public String ride() { return "riding ";} }
Error due to: interface methods cannot have body.
Question 5
Given:
 
What is the result of invoking Car's scop method?
  1. Both vehicles and Motorized's stop methods are invoked.
  2. Vehicles stop method is invoked.
  3. Motorized's stop method is invoked-
  4. The implementation of the Car's stop determines the behavior.
  5. Compilation fails.
Correct answer: D
Explanation:
The Car class is implementing the methods.Methods are not implemented in interfaces.
The Car class is implementing the methods.
Methods are not implemented in interfaces.
Question 6
Which type of ExecutorService supports the execution of tasks after a fixed delay?
  1. DelayedExecutorService
  2. ScheduledExecutorService
  3. TimedExecutorService
  4. FixedExecutorService
  5. FutureExecutorService
Correct answer: B
Explanation:
The ScheduledExecutorService interface supplements the methods of its parent ExecutorService with schedule, which executes a Runnable or Callable task after a specified delay. In addition, the interface defines scheduleAtFixedRate and scheduleWithFixedDelay, which executes specified tasks repeatedly, at defined intervals.Note:The java.util.concurrent package defines three executor interfaces:*Executor, a simple interface that supports launching new tasks. *ExecutorService, a subinterface of Executor, which adds features that help manage the lifecycle, both of the individual tasks and of the executor itself.*ScheduledExecutorService, a subinterface of ExecutorService, supports future and/or periodic execution of tasks.Reference: The Java Tutorials,Executor Interfaces
The ScheduledExecutorService interface supplements the methods of its parent ExecutorService with schedule, which executes a Runnable or Callable task after a specified delay. In addition, the interface defines scheduleAtFixedRate and scheduleWithFixedDelay, which executes specified tasks repeatedly, at defined intervals.
Note:The java.util.concurrent package defines three executor interfaces:
*Executor, a simple interface that supports launching new tasks. *ExecutorService, a subinterface of Executor, which adds features that help manage the lifecycle, both of the individual tasks and of the executor itself.
*ScheduledExecutorService, a subinterface of ExecutorService, supports future and/or periodic execution of tasks.
Reference: The Java Tutorials,Executor Interfaces
Question 7
Given the directory structure that contains three directories: company, Salesdat, and Finance:
Company
- Salesdat
* Target.dat
- Finance
* Salary.dat
* Annual.dat
And the code fragment:
 
If Company is the current directory, what is the result?
  1. Prints only Annual.dat
  2. Prints only Salesdat, Annual.dat
  3. Prints only Annual.dat, Salary.dat, Target.dat
  4. Prints at least Salesdat, Annual.dat, Salary.dat, Target.dat
Correct answer: A
Explanation:
IF !! return FileVisitResult.CONTINUE;The pattern *dat will match the directory name Salesdat and it will also match the file Annual.dat.It will not be matched to Target.dat which is in a subdirectory.
IF !! return FileVisitResult.CONTINUE;
The pattern *dat will match the directory name Salesdat and it will also match the file Annual.dat.
It will not be matched to Target.dat which is in a subdirectory.
Question 8
Given:
 
Which two are true about the lines labeled A through D?
  1. The code compiles and runs as is.
  2. If only line A is removed, the code will compile and run.
  3. If only line B is removed, the code will compile and run.
  4. If only line D is removed, the code will compile and run.
  5. Line C is optional to allow the code to compile and run.
  6. Line C is mandatory to allow the code to compile andrun.
Correct answer: AC
Question 9
Given:
StringBuffer b = new StringBuffer("3");
System.out.print(5+4+b+2+1);
What is the result?
  1. 54321
  2. 9321
  3. 5433
  4. 933
  5. Output is Similar to: 9java.lang.StringBuffer@100490121.
  6. Compilation fails.
Correct answer: F
Explanation:
The code will not compile.The print function cannot handle the mixture of integers and strings.Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous tree type
The code will not compile.
The print function cannot handle the mixture of integers and strings.
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous tree type
Question 10
Given:
 
Which two statements, inserted independently at line ***, enable the program to produce the following output:
We have 002 Blue pants that cost $24.99.
  1. System.out.printf("We have %03d %s pants that cost $%3.2f.n",quantity, color, price);
  2. System.out.printf("We have$03d$s pants that cost $$3.2f.n",quantity, color, price);
  3. String out = String.format ("We have %03d %s pants that cost $%3.2f.n",quantity, color, price);System.out.println(out);
  4. String out = System.out.format("We have %03d %s pants that cost $%3.2f.",quantity, color, price);System.out.println(out);
  5. System.out.format("We have %s%spants that cost $%s.n",quantity, color, price);
Correct answer: AC
HOW TO OPEN VCE FILES

Use VCE Exam Simulator to open VCE files
Avanaset

HOW TO OPEN VCEX FILES

Use ProfExam Simulator to open VCEX files
ProfExam Screen

ProfExam
ProfExam at a 20% markdown

You have the opportunity to purchase ProfExam at a 20% reduced price

Get Now!