[Udemy 100% Off]-Java Certification (OCP): Practice for 1Z0-809 Exam - 100% Free Udemy Discount Coupons For Online Courses

Breaking

Thursday, June 27, 2019

[Udemy 100% Off]-Java Certification (OCP): Practice for 1Z0-809 Exam

[Udemy 100% Off]-Java Certification (OCP): Practice for 1Z0-809 Exam
Description

This course is for a complete preparation of the Oracle Certified Professional (OCP) examination, includes 6 practice sets with  more than 380 multiple choice questions (MCQ) with detailed explanations. All questions have been designed based on the real exam questions. Some questions may have more than one answers because in the actual exam you might expect some questions with multiple answers.

Key features of practice sections and model test:
The code does not compile because the variable b is used twice in the main() method,

both in the method declaration and in the catch block, making Option C the correct

answer. If a different variable name was used in one of the locations, the program would

print one line, complete, making Option A the correct answer. Note that while an exception

is created inside the turnOn() method, it is not thrown.

SAMPLE QUESTIONS:
Sample - 1:  What is the output of the following application?
package world;

public class Matrix {

         private int level = 1;

         class Deep {

                    private int level = 2;

                    class Deeper {

                           private int level = 5;

                           public void printReality() {

                                     System.out.print(level);

                                     System.out.print(" "+Matrix.Deep.this.level);

                                      System.out.print(" "+Deep.this.level);

                             }

                      }

                }

     public static void main(String[] bots) {

                 Matrix.Deep.Deeper simulation = new Matrix().new Deep().new Deeper();

                 simulation.printReality();

     }

}

A. 1 1 2

B. 5 2 2

C. 5 2 1

D. The code does not compile

Answer:  B.

Explanation: The code compiles without issue, so Option D is incorrect. The first print() statement refers to value in the Deeper class, so 5 is printed. The second and third print() statements actually refer to the same value in the Deep class, so 2 is printed twice. The prefix Matrix. is unnecessary in the first of the two print() statements and does not change the result. For these reasons, Option B is the correct answer.

Sample - 2: Which lambda expression, when filled into the blank, allows the code to compile?
package ballroom;

import java.util.function.*;

public class Dance {

              public static Integer rest(BiFunction<Integer,Double,Integer> takeABreak) {

              return takeABreak.apply(3, 10.2);

             }

            public static void main(String[] participants) {

                    rest( );

            }

}

A. (int n, double e) -> (int)(n+e)

B. (n,w,e) -> System.out::print

C. (s,w) -> 2*w

D. (s,e) -> s.intValue() + e.intValue()

Answer:  D

Explanation: While lambda expressions can use primitive types as arguments, the functional interface in this class uses the wrapper classes, which are not compatible. For this reason, Option A is incorrect. Option B is also incorrect, since the number of arguments and return type does not match the functional interface. Furthermore, the method reference System.out::print on the right-hand side of the lambda expression is invalid here, since it returns a method reference, not a double value. Option C is incorrect because 2*w is of type double, which cannot be returned as an Integer without an explicit cast. Option D is the correct answer. It takes exactly two arguments because the return value int can be implicitly autoboxed to Integer.

Sample - 3: How many lines of text does the following program print?
package lighting;

import java.io.IOException;

public class Light {

        public void turnOn() throws IOException {

             new IOException("Not ready");

       }

      public static void main(String[] b) throws Exception {

            try {

                        new Light().turnOn();

             } catch (RuntimeException b) { // y1

                      System.out.println(b);

                      throw new IOException(); // y2

             } finally {

                     System.out.println("complete");

            }

     }

}

A. One

B. Two

C. The code does not compile because of line y1

D. The code does not compile because of line y2

Answer: C

Explanation: The code does not compile because the variable b is used twice in the main() method, both in the method declaration and in the catch block, making Option C the correct answer. If a different variable name was used in one of the locations, the program would print one line, complete, making Option A the correct answer. Note that while an exception is created inside the turnOn() method, it is not thrown.

Oracle Certified Professional (OCP) - Java SE 8 Programmer II Exam:
Exam Code: 1Z0-809

Duration: 2 hours 30 minutes

Questions #: 85 (Multiple Choice / Select from checkbox)

Passing score: 65%

OCP Exam Curriculum:

1. Java Class Design
Implement encapsulation

Implement inheritance including visibility modifiers and composition

Implement polymorphism

Override hashCode, equals, and toString methods from Object class

Create and use singleton classes and immutable classes

Develop code that uses static keyword on initialize blocks, variables, methods, and classes

2. Generics and Collections
Create and use a generic class

Create and use ArrayList, TreeSet, TreeMap, and ArrayDeque objects

Use java.util.Comparator and java.lang.Comparable interfaces

Collections Streams and Filters

Iterate using forEach methods of Streams and List

Describe Stream interface and Stream pipeline

Filter a collection by using lambda expressions

Use method references with Streams

3. Advanced Java Class Design
Develop code that uses abstract classes and methods

Develop code that uses the final keyword

Create inner classes including static inner class, local class, nested class, and anonymous inner class

Use enumerated types including methods, and constructors in an enum type

Develop code that declares, implements and/or extends interfaces and use the @Override annotation.

Create and use Lambda expressions

4. Lambda Built-in Functional Interfaces
Use the built-in interfaces included in the java.util.function package such as Predicate, Consumer, Function, and Supplier

Develop code that uses primitive versions of functional interfaces

Develop code that uses binary versions of functional interfaces

Develop code that uses the UnaryOperator interface

5. Java Stream API
Develop code to extract data from an object using peek() and map() methods including primitive versions of the map() method

Search for data by using search methods of the Stream classes including findFirst, findAny, anyMatch, allMatch, noneMatch

Develop code that uses the Optional class

Develop code that uses Stream data methods and calculation methods

Sort a collection using Stream API

Save results to a collection using the collect method and group/partition data using the Collectors class

Use flatMap() methods in the Stream API

6. Exceptions and Assertions
Use try-catch and throw statements

Use catch, multi-catch, and finally clauses

Use Autoclose resources with a try-with-resources statement

Create custom exceptions and Auto-closeable resources

Test invariants by using assertions

7. Use Java SE 8 Date/Time API
Create and manage date-based and time-based events including a combination of date and time into a single object using LocalDate, LocalTime, LocalDateTime, Instant, Period, and Duration

Work with dates and times across timezones and manage changes resulting from daylight savings including Format date and times values

Define and create and manage date-based and time-based events using Instant, Period, Duration, and TemporalUnit

8. Java I/O Fundamentals
Read and write data from the console

Use BufferedReader, BufferedWriter, File, FileReader, FileWriter, FileInputStream, FileOutputStream, ObjectOutputStream, ObjectInputStream, and PrintWriter in the IO package.

9. Java File I/O (NIO.2)
Use Path interface to operate on file and directory paths

Use Files class to check, read, delete, copy, move, manage metadata of a file or directory

Use Stream API with NIO.2

10. Java Concurrency
Create worker threads using Runnable, Callable and use an ExecutorService to concurrently execute tasks

Identify potential threading problems among deadlock, starvation, livelock, and race conditions

Use synchronized keyword and java.util.concurrent.atomic package to control the order of thread execution

Use java.util.concurrent collections and classes including CyclicBarrier and CopyOnWriteArrayList

Use parallel Fork/Join Framework

Use parallel Streams including reduction, decomposition, merging processes, pipelines and performance.

11. Building Database Applications with JDBC
Describe the interfaces that make up the core of the JDBC API including the Driver, Connection, Statement, and ResultSet interfaces and their relationship to provider implementations

Identify the components required to connect to a database using the DriverManager class including the JDBC URL

Submit queries and read results from the database including creating statements, returning result sets, iterating through the results, and properly closing result sets, statements, and connections

12. Localization
Read and set the locale by using the Locale object

Create and read a Properties file

Build a resource bundle for each locale and load a resource bundle in an application

Registration and more information: Visit Oracle Certification Website

No comments:

Post a Comment