
OCA/OCP Java SE 8 Programmer Certification Bundle (Exams 1Z0-808 and 1Z0-809)
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
More details
Content
- Cover
- Copyright Page
- Contents
- OCA Java® SE 8 Programmer I Exam Guide (Exam 1Z0-808)
- Cover
- Title Page
- Copyright Page
- Contents
- Acknowledgments
- Preface
- Introduction
- 1 Declarations and Access Control
- Java Refresher
- Features and Benefits of Java (OCA Objective 1.5)
- Identifiers and Keywords (OCA Objectives 1.2 and 2.1)
- Legal Identifiers
- Oracle's Java Code Conventions
- Define Classes (OCA Objectives 1.2, 1.3, 1.4, 6.4, and 7.5)
- Source File Declaration Rules
- Using the javac and java Commands
- Using public static void main(String[ ] args)
- Import Statements and the Java API
- Static Import Statements
- Class Declarations and Modifiers
- Exercise 1-1: Creating an Abstract Superclass and Concrete Subclass
- Use Interfaces (OCA Objective 7.5)
- Declaring an Interface
- Declaring Interface Constants
- Declaring default Interface Methods
- Declaring static Interface Methods
- Declare Class Members (OCA Objectives 2.1, 2.2, 2.3, 4.1, 4.2, 6.2, 6.3, and 6.4)
- Access Modifiers
- Nonaccess Member Modifiers
- Constructor Declarations
- Variable Declarations
- Declare and Use enums (OCA Objective 1.2)
- Declaring enums
- Certification Summary
- Two-Minute Drill
- Q&A Self Test
- Self Test Answers
- 2 Object Orientation
- Encapsulation (OCA Objectives 6.1 and 6.5)
- Inheritance and Polymorphism (OCA Objectives 7.1 and 7.2)
- The Evolution of Inheritance
- IS-A and HAS-A Relationships
- Polymorphism (OCA Objective 7.2)
- Overriding/Overloading (OCA Objectives 6.1 and 7.2)
- Overridden Methods
- Overloaded Methods
- Casting (OCA Objectives 2.2 and 7.3)
- Implementing an Interface (OCA Objective 7.5)
- Java 8-Now with Multiple Inheritance!
- Legal Return Types (OCA Objectives 2.2 and 6.1)
- Return Type Declarations
- Returning a Value
- Constructors and Instantiation (OCA Objectives 6.3 and 7.4)
- Constructor Basics
- Constructor Chaining
- Rules for Constructors
- Determine Whether a Default Constructor Will Be Created
- Overloaded Constructors
- Initialization Blocks (OCA Objectives 1.2 and 6.3-ish)
- Statics (OCA Objective 6.2)
- Static Variables and Methods
- Certification Summary
- Two-Minute Drill
- Q&A Self Test
- Self Test Answers
- 3 Assignments
- Stack and Heap-Quick Review
- Literals, Assignments, and Variables (OCA Objectives 2.1, 2.2, and 2.3)
- Literal Values for All Primitive Types
- Assignment Operators
- Exercise 3-1: Casting Primitives
- Scope (OCA Objective 1.1)
- Variable Scope
- Variable Initialization (OCA Objectives 2.1, 4.1, and 4.2)
- Using a Variable or Array Element That Is Uninitialized and Unassigned
- Local (Stack, Automatic) Primitives and Objects
- Passing Variables into Methods (OCA Objective 6.6)
- Passing Object Reference Variables
- Does Java Use Pass-By-Value Semantics?
- Passing Primitive Variables
- Garbage Collection (OCA Objective 2.4)
- Overview of Memory Management and Garbage Collection
- Overview of Java's Garbage Collector
- Writing Code That Explicitly Makes Objects Eligible for Collection
- Exercise 3-2: Garbage Collection Experiment
- Certification Summary
- Two-Minute Drill
- Q&A Self Test
- Self Test Answers
- 4 Operators
- Java Operators (OCA Objectives 3.1, 3.2, and 3.3)
- Assignment Operators
- Relational Operators
- instanceof Comparison
- Arithmetic Operators
- Conditional Operator
- Logical Operators
- Operator Precedence
- Certification Summary
- Two-Minute Drill
- Q&A Self Test
- Self Test Answers
- 5 Flow Control and Exceptions
- Using if and switch Statements (OCA Objectives 3.3 and 3.4)
- if-else Branching
- switch Statements
- Exercise 5-1: Creating a switch-case Statement
- Creating Loops Constructs (OCA Objectives 5.1, 5.2, 5.3, 5.4, and 5.5)
- Using while Loops
- Using do Loops
- Using for Loops
- Using break and continue
- Unlabeled Statements
- Labeled Statements
- Exercise 5-2: Creating a Labeled while Loop
- Handling Exceptions (OCA Objectives 8.1, 8.2, 8.3, 8.4, and 8.5)
- Catching an Exception Using try and catch
- Using finally
- Propagating Uncaught Exceptions
- Exercise 5-3: Propagating and Catching an Exception
- Defining Exceptions
- Exception Hierarchy
- Handling an Entire Class Hierarchy of Exceptions
- Exception Matching
- Exception Declaration and the Public Interface
- Exercise 5-4: Creating an Exception
- Rethrowing the Same Exception
- Common Exceptions and Errors (OCA Objective 8.5)
- Where Exceptions Come From
- JVM-Thrown Exceptions
- Programmatically Thrown Exceptions
- A Summary of the Exam's Exceptions and Errors
- Certification Summary
- Two-Minute Drill
- Q&A Self Test
- Self Test Answers
- 6 Strings, Arrays, ArrayLists, Dates, and Lambdas
- Using String and StringBuilder (OCA Objectives 9.2 and 9.1)
- The String Class
- Important Facts About Strings and Memory
- Important Methods in the String Class
- The StringBuilder Class
- Important Methods in the StringBuilder Class
- Working with Calendar Data (OCA Objective 9.3)
- Immutability
- Factory Classes
- Using and Manipulating Dates and Times
- Formatting Dates and Times
- Using Arrays (OCA Objectives 4.1 and 4.2)
- Declaring an Array
- Constructing an Array
- Initializing an Array
- Using ArrayLists and Wrappers (OCA Objectives 9.4 and 2.5)
- When to Use ArrayLists
- ArrayList Methods in Action
- Important Methods in the ArrayList Class
- Autoboxing with ArrayLists
- The Java 7 "Diamond" Syntax
- Advanced Encapsulation (OCA Objective 6.5)
- Encapsulation for Reference Variables
- Using Simple Lambdas (OCA Objective 9.5)
- Certification Summary
- Two-Minute Drill
- Q&A Self Test
- Self Test Answers
- A About the Download
- System Requirements
- Downloading from McGraw-Hill Professional's Media Center
- Installing the Practice Exam Software
- Running the Practice Exam Software
- Practice Exam Software Features
- Removing Installation
- Help
- Technical Support
- Windows 8 Troubleshooting
- McGraw-Hill Education Content Support
- Index
- OCP Java SE 8 Programmer II Exam Guide (Exam 1Z0-809)
- 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: ePUB
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 (not Kindle).
The file format ePub works well for novels and non-fiction books – i.e., „flowing” text without complex layout. On an e-reader or smartphone, line and page breaks automatically adjust to fit the small displays.
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.
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.