
OCP Java SE 8 Programmer II Exam Guide (Exam 1Z0-809)
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
Study for the OCP Java SE 8 Programmer II exam using this effective exam preparation guide from Oracle Press. Written by a team of experts, including two developers of the original exam, OCP Java SE 8 Programmer II Exam Guide (Exam 1Z0-809) offers comprehensive coverage of every subject on the test and lays out essential Java programming skills. Throughout, step-by-step exercises; self-tests; and "Exam Watch," "Inside the Exam," and "On the Job" sections highlight salient points and aid in learning. In all, the book and accompanying digital content feature more than 350 practice questions that mirror those on the live test in tone, format, and content.
More details
Content
- Cover
- Title Page
- Copyright Page
- Dedication
- Contents
- Acknowledgments
- Preface
- Introduction
- 1 Declarations, Access Control, and Enums
- Java Class Design and Object Orientation: A Refresher
- Define Classes and Interfaces (OCP Objectives 1.2, 2.1, and 2.2)
- Class Declarations and Modifiers
- Exercise 1-1: Creating an Abstract Superclass and Concrete Subclass
- Use Interfaces (OCP Objective 2.5)
- Declaring an Interface
- Declaring Interface Constants
- Declaring default Interface Methods
- Declaring static Interface Methods
- Declare Class Members (OCP Objectives 1.2, 1.6, 2.1, and 2.2)
- Access Modifiers
- Nonaccess Member Modifiers
- Constructor Declarations
- Variable Declarations
- Declare and Use enums (OCP Objective 2.4)
- Declaring enums
- Certification Summary
- Two-Minute Drill
- Q&A Self Test
- Self Test Answers
- 2 Object Orientation
- Encapsulation (OCP Objective 1.1)
- Inheritance and Polymorphism (OCP Objectives 1.2 and 1.3)
- The Evolution of Inheritance
- IS-A and HAS-A Relationships
- Polymorphism (OCP Objective 1.3)
- Overriding/Overloading (OCP Objectives 1.2, 1.3, and 2.5)
- Overridden Methods
- Overloaded Methods
- Casting (OCP Objectives 1.2 and 1.3)
- Implementing an Interface (OCP Objective 2.5)
- Java 8-Now with Multiple Inheritance!
- Legal Return Types (OCP Objectives 1.2 and 1.3)
- Return Type Declarations
- Returning a Value
- Constructors and Instantiation (OCP Objectives 1.2 and 1.3)
- Constructor Basics
- Constructor Chaining
- Rules for Constructors
- Determine Whether a Default Constructor Will Be Created
- Overloaded Constructors
- Singleton Design Pattern (OCP Objective 1.5)
- What Is a Design Pattern?
- Problem
- Solution
- Benefits
- Immutable Classes (OCP Objective 1.5)
- Initialization Blocks (OCP Objective 1.6)
- Statics (OCP Objective 1.6)
- Static Variables and Methods
- Certification Summary
- Two-Minute Drill
- Q&A Self Test
- Self Test Answers
- 3 Assertions and Java Exceptions
- Working with the Assertion Mechanism (OCP Objective 6.5)
- Assertions Overview
- Using Assertions
- Using Assertions Appropriately
- Working with Exception Handling (OCP Objectives 6.1, 6.2, 6.3, and 6.4)
- Use the try Statement with multi-catch and finally Clauses
- AutoCloseable Resources with a try-with-resources Statement
- Certification Summary
- Two-Minute Drill
- Q&A Self Test
- Self Test Answers
- 4 Dates, Times, Locales, and Resource Bundles
- Dates, Times, and Locales (OCP Objectives 7.1, 7.2, 7.3, and 12.1)
- Working with Dates and Times
- The java.time.* Classes for Dates and Times
- Properties Files (OCP Objective 12.2)
- Resource Bundles (OCP Objectives 12.1, 12.2, and 12.3)
- Java Resource Bundles
- Default Locale
- Choosing the Right Resource Bundle
- Certification Summary
- Two-Minute Drill
- Q&A Self Test
- Self Test Answers
- 5 I/O and NIO
- File Navigation and I/O (OCP Objectives 8.1 and 8.2)
- Creating Files Using the File Class
- Using FileWriter and FileReader
- Using FileInputStream and FileOutputStream
- Combining I/O Classes
- Working with Files and Directories
- The java.io.Console Class
- Files, Path, and Paths (OCP Objectives 9.1 and 9.2)
- Creating a Path
- Creating Files and Directories
- Copying, Moving, and Deleting Files
- Retrieving Information about a Path
- Normalizing a Path
- Resolving a Path
- Relativizing a Path
- File and Directory Attributes (OCP Objective 9.2)
- Reading and Writing Attributes the Easy Way
- Types of Attribute Interfaces
- Working with BasicFileAttributes
- Working with DosFileAttributes
- Working with PosixFileAttributes
- Reviewing Attributes
- DirectoryStream (OCP Objectives 9.2 and 9.3)
- FileVisitor
- PathMatcher
- WatchService
- Serialization (Objective 8.2)
- Working with ObjectOutputStream and ObjectInputStream
- Object Graphs
- Using writeObject and readObject
- How Inheritance Affects Serialization
- Serialization Is Not for Statics
- Certification Summary
- Two-Minute Drill
- Q&A Self Test
- Self Test Answers
- 6 Generics and Collections
- Override hashCode(), equals(), and toString() (OCP Objective 1.4)
- The toString() Method
- Overriding equals()
- Overriding hashCode()
- Collections Overview (OCP Objective 3.2)
- So What Do You Do with a Collection?
- Key Interfaces and Classes of the Collections Framework
- List Interface
- Set Interface
- Map Interface
- Queue Interface
- Using Collections (OCP Objectives 2.6, 3.2, and 3.3)
- ArrayList Basics
- Autoboxing with Collections
- The Java 7 "Diamond" Syntax
- Sorting Collections and Arrays
- Navigating (Searching) TreeSets and TreeMaps
- Other Navigation Methods
- Backed Collections
- Using the PriorityQueue Class and the Deque Interface
- Method Overview for Arrays and Collections
- Method Overview for List, Set, Map, and Queue
- Generic Types (OCP Objective 3.1)
- The Legacy Way to Do Collections
- Generics and Legacy Code
- Mixing Generic and Nongeneric Collections
- Polymorphism and Generics
- Generic Methods
- Generic Declarations
- Certification Summary
- Two-Minute Drill
- Q&A Self Test
- Self Test Answers
- 7 Inner Classes
- Nested Classes (OCP Objective 2.3)
- Inner Classes
- Coding a "Regular" Inner Class
- Referencing the Inner or Outer Instance from Within the Inner Class
- Method-Local Inner Classes
- What a Method-Local Inner Object Can and Can't Do
- Anonymous Inner Classes
- Plain-Old Anonymous Inner Classes, Flavor One
- Plain-Old Anonymous Inner Classes, Flavor Two
- Argument-Defined Anonymous Inner Classes
- Static Nested Classes
- Instantiating and Using Static Nested Classes
- Lambda Expressions as Inner Classes (OCP Objective 2.6)
- Comparator Is a Functional Interface
- Certification Summary
- Two-Minute Drill
- Q&A Self Test
- Self Test Answers
- 8 Lambda Expressions and Functional Interfaces
- Lambda Expression Syntax (OCP Objective 2.6)
- Passing Lambda Expressions to Methods
- Accessing Variables from Lambda Expressions
- Functional Interfaces (OCP Objectives 3.5, 4.1, 4.2, 4.3, and 4.4)
- Built-in Functional Interfaces
- What Makes an Interface Functional?
- Categories of Functional Interfaces
- Method References (OCP Objective 3.8)
- Kinds of Method References
- Write Your Own Functional Interface
- Functional Interface Overview
- Certification Summary
- Two-Minute Drill
- Q&A Self Test
- Self Test Answers
- 9 Streams
- What Is a Stream? (OCP Objective 3.4)
- How to Create a Stream (OCP Objectives 3.5 and 9.3)
- Create a Stream from a Collection
- Build a Stream with Stream.of()
- Create a Stream from an Array
- Create a Stream from a File
- Primitive Value Streams
- Summary of Methods to Create Streams
- Why Streams?
- The Stream Pipeline (OCP Objective 3.6)
- Streams Are Lazy
- Operating on Streams (OCP Objectives 3.7 and 5.1)
- Map-Filter-Reduce with average() and Optionals (OCP Objectives 5.3 and 5.4)
- Reduce
- Using reduce()
- Associative Accumulations
- map-filter-reduce Methods
- Optionals (OCP Objective 5.3)
- Searching and Sorting with Streams (OCP Objectives 5.2 and 5.5)
- Searching to See Whether an Element Exists
- Searching to Find and Return an Object
- Sorting
- Methods to Search and Sort Streams
- Don't Modify the Source of a Stream
- Collecting Values from Streams (OCP Objectives 3.8, 5.6, and 9.3)
- Using collect() with Files.lines()
- Exercise 9-1: Collecting Items in a List
- Grouping and Partitioning
- Summing and Averaging
- Counting, joining, maxBy, and minBy
- Stream Methods to Collect and Their Collectors
- Streams of Streams (OCP Objective 5.7)
- Generating Streams (OCP Objective 3.4)
- Methods to Generate Streams
- Caveat Time Again
- A Taste of Parallel Streams
- Certification Summary
- Two-Minute Drill
- Q&A Self Test
- Self Test Answers
- Exercise Answer
- 10 Threads
- Defining, Instantiating, and Starting Threads (OCP Objective 10.1)
- Making a Thread
- Defining a Thread
- Instantiating a Thread
- Starting a Thread
- Thread States and Transitions
- Thread States
- Preventing Thread Execution
- Sleeping
- Exercise 10-1: Creating a Thread and Putting It to Sleep
- Thread Priorities and yield( )
- Synchronizing Code, Thread Problems (OCP Objectives 10.2 and 10.3)
- Preventing the Account Overdraw
- Synchronization and Locks
- Exercise 10-2: Synchronizing a Block of Code
- Thread Deadlock
- Thread Livelock
- Thread Starvation
- Race Conditions
- Thread Interaction (OCP Objectives 10.2 and 10.3)
- Using notifyAll( ) When Many Threads May Be Waiting
- Certification Summary
- Two-Minute Drill
- Q&A Self Test
- Self Test Answers
- Exercise Answers
- 11 Concurrency
- Concurrency with the java.util.concurrent Package
- Apply Atomic Variables and Locks (OCP Objective 10.3)
- Atomic Variables
- Locks
- Use java.util.concurrent Collections (OCP Objective 10.4)
- Copy-on-Write Collections
- Concurrent Collections
- Blocking Queues
- Controlling Threads with CyclicBarrier
- Use Executors and ThreadPools (OCP Objective 10.1)
- Identifying Parallel Tasks
- How Many Threads Can You Run?
- CPU-Intensive vs. I/O-Intensive Tasks
- Fighting for a Turn
- Decoupling Tasks from Threads
- Use the Parallel Fork/Join Framework (OCP Objective 10.5)
- Divide and Conquer
- ForkJoinPool
- ForkJoinTask
- Parallel Streams (OCP Objective 10.6)
- How to Make a Parallel Stream Pipeline
- Embarrassingly Parallel, Take Two (with Parallel Streams)
- A Parallel Stream Implementation of a RecursiveTask
- Reducing Parallel Streams with reduce()
- Certification Summary
- Two-Minute Drill
- Q&A Self Test
- Self Test Answers
- 12 JDBC
- Starting Out: Introduction to Databases and JDBC
- Talking to a Database
- Bob's Books, Our Test Database
- Core Interfaces of the JDBC API (OCP Objective 11.1)
- Connect to a Database Using DriverManager (OCP Objective 11.2)
- The DriverManager Class
- The JDBC URL
- JDBC Driver Implementation Versions
- Submit Queries and Read Results from the Database (OCP Objective 11.3)
- All of Bob's Customers
- Statements
- ResultSets
- When Things Go Wrong-Exceptions and Warnings
- Certification Summary
- Two-Minute Drill
- Q&A Self Test
- Self Test Answers
- A About the Online Content
- McGraw-Hill Professional Media Center Download
- Total Tester Online System Requirements
- Single User License Terms and Conditions
- Total Tester Online
- Technical Support
- Index
System requirements
File format: PDF
Copy-Protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (only limited: Kindle).
The file format PDF always displays a book page identically on any hardware. This makes PDF suitable for complex layouts such as those used in textbooks and reference books (images, tables, columns, footnotes). Unfortunately, on the small screens of e-readers or smartphones, PDFs are rather annoying, requiring too much scrolling.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our eBook Help page.