Download Upgrade to Java SE 8 OCP.1z0-813.Prep4Sure.2018-09-05.36q.vcex

Vendor: Oracle
Exam Code: 1z0-813
Exam Name: Upgrade to Java SE 8 OCP
Date: Sep 05, 2018
File Size: 2 MB

How to open VCEX files?

Files with VCEX extension can be opened by ProfExam Simulator.

Purchase
Coupon: EXAM_HUB

Discount: 20%

Demo Questions

Question 1
Given:
 
 
and the code fragment:
  
What is the result?
  1. A compilation error occurs. 
  2. 2000.0
  3. 1500.0
  4. 0.0
Correct answer: A
Explanation:
The line mapToInt(Person::GetSalary) will cause a compile error.If it is replaced by the following line, a "." is added in the beginning of the line, the result would be 1500.0:.mapToInt(Person::getSalary)
The line mapToInt(Person::GetSalary) will cause a compile error.
If it is replaced by the following line, a "." is added in the beginning of the line, the result would be 1500.0:
.mapToInt(Person::getSalary)
Question 2
Which two codes correctly represent a standard language locale code? (Choose two.)
  1. u8
  2. fr
  3. es
  4. U8
  5. FR
  6. ES
Correct answer: BC
Explanation:
Language codes use lowercase. The following examples create Locale objects for the French language in Canada, the English language in the U.S. and Great Britain. aLocale = new Locale("fr", "CA"); bLocale = new Locale("en", "US"); cLocale = new Locale("en", "GB"); Reference: https://docs.oracle.com/javase/tutorial/i18n/locale/create.html
Language codes use lowercase. 
The following examples create Locale objects for the French language in Canada, the English language in the U.S. and Great Britain. 
aLocale = new Locale("fr", "CA"); 
bLocale = new Locale("en", "US"); 
cLocale = new Locale("en", "GB"); 
Reference: https://docs.oracle.com/javase/tutorial/i18n/locale/create.html
Question 3
Given the code fragment:
 
 
What is the result? 
  1. Word: why what when
  2. Words: why Word: Why what Word: why what when
  3. Word: why Word: what Word: when
  4. Compilation fails.
Correct answer: A
Question 4
Given the code fragment:
 
 
If exceptions occur when closing the FileWriter object and when retrieving the JString class object, which exception object is propagated up to the caller of the processFile method?
  1. java.lang.Exception
  2. java.io.IOException
  3. java.lang.ClassNotFoundException
  4. java.lang.NoSuchClassException
Correct answer: C
Explanation:
ClassNotFoundException is thrown when an application tries to load in a class through its string name using:The forName method in class Class. The findSystemClass method in class ClassLoader . The loadClass method in class ClassLoader. but no definition for the class with the specified name could be found. References: https://docs.oracle.com/javase/7/docs/api/java/lang/ClassNotFoundException.html
ClassNotFoundException is thrown when an application tries to load in a class through its string name using:
  • The forName method in class Class. 
  • The findSystemClass method in class ClassLoader . 
  • The loadClass method in class ClassLoader. 
but no definition for the class with the specified name could be found. 
References: https://docs.oracle.com/javase/7/docs/api/java/lang/ClassNotFoundException.html
Question 5
Given:
  
What is the result when you compile the code and execute the command:
java MyApp kava 
  1. kava
  2. Kava
  3. kawa
  4. Kawa
  5. An exception is thrown at runtime.
Correct answer: D
Question 6
Given the code fragment:
 
 
and 
 
 
Which code fragment could you see to refactor the code from line 4 to 8 to use a Lambda expression?
  1. Vehicle v = new Vehicle(int speed) { System.out.print(“Fly at “ + speed); );
  2. Vehicle v = int speed -> System.out.print(“Fly at “ + speed);
  3. Vehicle v = (int speed) -> System.out.print(“Fly at “ + speed);
  4. Vehicle v = speed -> {System.out.print(“Fly at “ + speed) };
Correct answer: C
Question 7
Given the code fragment:
 
 
What is the result? 
  1. 0 0
  2. 1 2
  3. 1 4
  4. A compilation error occurs
Correct answer: D
Explanation:
A compilation error will occur at the following line:map.compute("1", (k, v) -> (v == null) ? k * k : 0 );The error is:Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - bad operand types for binary operator '*'first type: java.lang.Stringsecond type: java.lang.String
A compilation error will occur at the following line:
map.compute("1", (k, v) -> (v == null) ? k * k : 0 );
The error is:
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - bad operand types for binary operator '*'
first type: java.lang.String
second type: java.lang.String
Question 8
Given the incomplete pseudo-code for a fork/join framework application:
 
 
And given the missing methods:
process, submit, and splitInHalf 
Which three insertions properly complete the pseudo-code? (Choose three.)
  1. Insert process at line Z.
  2. Insert process at line X.
  3. Insert submit at line X.
  4. Insert splitInHalf at line X.
  5. Insert process at line Y.
  6. Insert splitInHalf at line Y.
  7. Insert submit at line Z.
Correct answer: BFG
Explanation:
B: If the size is small enough then process the work.D: If the size is not small enough then slit up the wok in half.G: Submit the two split up pieces of work recursively.Note: Your code should look similar to the following pseudocode:    Reference: https://docs.oracle.com/javase/tutorial/essential/concurrency/forkjoin.html
B: If the size is small enough then process the work.
D: If the size is not small enough then slit up the wok in half.
G: Submit the two split up pieces of work recursively.
Note: Your code should look similar to the following pseudocode:
  
Reference: https://docs.oracle.com/javase/tutorial/essential/concurrency/forkjoin.html
Question 9
Given the code fragment:
 
 
Which code fragment, when inserted at line n1, enables the code to print the count of string elements whose length is greater than three?
  1. listVal.stream().filter(x -> x.length() > 3).count()
  2. listVal.stream().map(x -> x.length() > 3).count()
  3. listVal.stream().peek(x -> x.length() > 3).count().get()
  4. listVal.stream().filter(x -> x.length() > 3).mapToInt(x -> x).count()
Correct answer: A
Explanation:
Gives the correct output of 2. Incorrect Answers:B: Output is 4.C, D: Does not compile.
Gives the correct output of 2. 
Incorrect Answers:
B: Output is 4.
C, D: Does not compile.
Question 10
Given the code fragments:
 
 
and 
 
 
What is the result?
  1. A compilation error occurs at line n2.
  2. The program prints Run… and throws an exception. 
    Run…
  3. Call…
  4. A compilation errors occurs at line n1.
Correct answer: A
HOW TO OPEN VCE FILES

Use VCE Exam Simulator to open VCE files
Avanaset

HOW TO OPEN VCEX AND EXAM FILES

Use ProfExam Simulator to open VCEX and EXAM files
ProfExam Screen

ProfExam
ProfExam at a 20% markdown

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

Get Now!