OCA / OCP Java SE 8 Programmer Certification Kit
Exam 1Z0-808 and Exam 1Z0-809
Häftad, Engelska, 2016
Av Jeanne Boyarsky, Scott Selikoff, Jeanne (CodeRanch) Boyarsky, LLC) Selikoff, Scott (Selikoff Solutions
779 kr
Produktinformation
- Utgivningsdatum2016-06-21
- Mått185 x 234 x 66 mm
- Vikt1 724 g
- FormatHäftad
- SpråkEngelska
- Antal sidor1 152
- FörlagJohn Wiley & Sons Inc
- ISBN9781119272090
Tillhör följande kategorier
Jeanne Boyarsky (New York, NY), has worked as a Java developer for a bank in NYC for 11 years where she develops, mentors and conducts training. In her free time, she is a senior moderator at CodeRanch and works on the forum code base. Jeanne has also mentored the programming division of a FIRST robotics team since 2009 where she works with students just learning Java. You can find more information about Jeanne at her bio at CodeRanch (www.coderanch.com/how-to/java/BioJeanneBoyarsky).Scott Selikoff (Bridgewater, NJ) has been a Java Enterprise developer for over 14 years. He started off working for a number of tech startups, as well as medical and pharmaceutical companies in the Philadelphia area, including Siemens Medical Solutions. In 2006, he started his own consulting firm called Selikoff Solutions, LLC, which specializes in building custom mobile and server solutions for businesses in the NYC/NJ area. Besides training new developers, Scott also enjoys teaching and has given lectures at both Cornell University and Rutgers University. Both are regular contributors to Scott's website, Down Home Country Coding (www.selikoff.net).
- OCA: Oracle Certified Associate Java SE 8 Programmer I Study Guide: Exam 1Z0-808Introduction xxiAssessment Test xxxiChapter 1 Java Building Blocks 1Understanding the Java Class Structure 2Fields and Methods 2Comments 4Classes vs. Files 5Writing a main() Method 6Understanding Package Declarations and Imports 9Wildcards 10Redundant Imports 11Naming Conflicts 12Creating a New Package 13Code Formatting on the Exam 16Creating Objects 16Constructors 17Reading and Writing Object Fields 18Instance Initializer Blocks 18Order of Initialization 19Distinguishing Between Object References and Primitives 20Primitive Types 20Reference Types 24Key Differences 25Declaring and Initializing Variables 25Declaring Multiple Variables 26Identifiers 27Understanding Default Initialization of Variables 29Local Variables 29Instance and Class Variables 30Understanding Variable Scope 31Ordering Elements in a Class 34Destroying Objects 36Garbage Collection 36finalize() 38Benefits of Java 39Summary 40Exam Essentials 41Review Questions 42Chapter 2 Operators and Statements 51Understanding Java Operators 52Working with Binary Arithmetic Operators 53Arithmetic Operators 53Numeric Promotion 55Working with Unary Operators 57Logical Complement and Negation Operators 57Increment and Decrement Operators 58Using Additional Binary Operators 60Assignment Operators 60Compound Assignment Operators 62Relational Operators 63Logical Operators 64Equality Operators 65Understanding Java Statements 66The if-then Statement 67The if-then-else Statement 68The switch Statement 72The while Statement 76The do-while Statement 78The for Statement 80Understanding Advanced Flow Control 86Nested Loops 87Adding Optional Labels 87The break Statement 88The continue Statement 90Summary 92Exam Essentials 92Review Questions 94Chapter 3 Core Java APIs 101Creating and Manipulating Strings 102Concatenation 102Immutability 104The String Pool 105Important String Methods 105Method Chaining 110Using the StringBuilder Class 111Mutability and Chaining 112Creating a StringBuilder 113Important StringBuilder Methods 114StringBuilder vs. StringBuffer 117Understanding Equality 117Understanding Java Arrays 119Creating an Array of Primitives 119Creating an Array with Reference Variables 121Using an Array 123Sorting 124Searching 125Varargs 126Multidimensional Arrays 126Understanding an ArrayList 129Creating an ArrayList 129Using an ArrayList 130Wrapper Classes 134Autoboxing 136Converting Between array and List 136Sorting 138Working with Dates and Times 138Creating Dates and Times 138Manipulating Dates and Times 142Working with Periods 145Formatting Dates and Times 148Parsing Dates and Times 151Summary 151Exam Essentials 152Review Questions 153Chapter 4 Methods and Encapsulation 165Designing Methods 166Optional Specifiers 168Return Type 169Method Name 170Parameter List 171Optional Exception List 171Method Body 171Working with Varargs 172Applying Access Modifiers 173Private Access 173Default (Package Private) Access 175Protected Access 176Public Access 180Designing Static Methods and Fields 181Calling a Static Variable or Method 182Static vs. Instance 183Static Variables 185Static Initialization 186Static Imports 187Passing Data Among Methods 188Overloading Methods 191Creating Constructors 196Default Constructor 197Overloading Constructors 199Final Fields 202Order of Initialization 202Encapsulating Data 205Creating Immutable Classes 207Writing Simple Lambdas 208Lambda Example 209Lambda Syntax 211Predicates 214Summary 215Exam Essentials 216Review Questions 218Chapter 5 Class Design 233Introducing Class Inheritance 234Extending a Class 235Applying Class Access Modifiers 237Creating Java Objects 237Defining Constructors 238Calling Inherited Class Members 244Inheriting Methods 246Inheriting Variables 257Creating Abstract Classes 259Defining an Abstract Class 260Creating a Concrete Class 262Extending an Abstract Class 263Implementing Interfaces 266Defining an Interface 267Inheriting an Interface 269Interface Variables 273Default Interface Methods 274Static Interface Methods 278Understanding Polymorphism 279Object vs. Reference 281Casting Objects 282Virtual Methods 284Polymorphic Parameters 285Polymorphism and Method Overriding 287Summary 288Exam Essentials 289Review Questions 291Chapter 6 Exceptions 299Understanding Exceptions 300The Role of Exceptions 300Understanding Exception Types 302Throwing an Exception 304Using a try Statement 305Adding a finally Block 307Catching Various Types of Exceptions 309Throwing a Second Exception 311Recognizing Common Exception Types 313Runtime Exceptions 314Checked Exceptions 317Errors 317Calling Methods That Throw Exceptions 318Subclasses 319Printing an Exception 321Summary 323Exam Essentials 324Review Questions 325Appendix A Answers to Review Questions 333Chapter 1: Java Building Blocks 334Chapter 2: Operators and Statements 336Chapter 3: Core Java APIs 339Chapter 4: Methods and Encapsulation 342Chapter 5: Class Design 346Chapter 6: Exceptions 349Appendix B Study Tips 353Studying for the Test 354Creating a Study Plan 354Creating and Running Sample Applications 355Taking the Test 359Understanding the Question 359Applying Process of Elimination 362Optimizing Your Time 364Getting a Good Night’s Rest 366Index 367OCP: Oracle Certified Professional Java SE 8 Programmer II Study Guide: Exam 1Z0-809Introduction xixAssessment Test xxxviiiChapter 1 Advanced Class Design 1Reviewing OCA Concepts 2Access Modifiers 2Overloading and Overriding 4Abstract Classes 5Static and Final 6Imports 6Using instance of 7Understanding Virtual Method Invocation 9Annotating Overridden Methods 11Coding equals, hashCode, and toString 13toString 13equals 15hashCode 18Working with Enums 20Using Enums in Switch Statements 21Adding Constructors, Fields, and Methods 22Creating Nested Classes 24Member Inner Classes 25Local Inner Classes 27Anonymous Inner Classes 29Static Nested Classes 31Summary 33Exam Essentials 34Review Questions 36Chapter 2 Design Patterns and Principles 47Designing an Interface 48Purpose of an Interface 51Introducing Functional Programming 52Defining a Functional Interface 53Implementing Functional Interfaces with Lambdas 55Applying the Predicate Interface 60Implementing Polymorphism 61Distinguishing between an Object and a Reference 63Casting Object References 64Understanding Design Principles 66Encapsulating Data 66Creating JavaBeans 69Applying the Is]a Relationship 71Applying the Has]a Relationship 73Composing Objects 74Working with Design Patterns 75Applying the Singleton Pattern 76Creating Immutable Objects 82Using the Builder Pattern 86Creating Objects with the Factory Pattern 89Summary 93Exam Essentials 93Review Questions 95Chapter 3 Generics and Collections 103Reviewing OCA Collections 104Array and ArrayList 104Searching and Sorting 105Wrapper Classes and Autoboxing 106The Diamond Operator 107Working with Generics 108Generic Classes 109Generic Interfaces 112Generic Methods 114Interacting with Legacy Code 114Bounds 117Putting It All Together 122Using Lists, Sets, Maps, and Queues 124Common Collections Methods 125Using the List Interface 127Using the Set Interface 132Using the Queue Interface 134Map 138Comparing Collection Types 140Comparator vs. Comparable 143Comparable 143Comparator 146Searching and Sorting 150Additions in Java 8 152Using Method References 152Removing Conditionally 154Updating All Elements 155Looping through a Collection 155Using New Java 8 Map APIs 155Summary 159Exam Essentials 161Review Questions 162Chapter 4 Functional Programming 171Using Variables in Lambdas 172Working with Built-In Functional Interfaces 173Implementing Supplier 174Implementing Consumer and BiConsumer 175Implementing Predicate and BiPredicate 177Implementing Function and BiFunction 178Implementing UnaryOperator and BinaryOperator 180Checking Functional Interfaces 181Returning an Optional 182Using Streams 185Creating Stream Sources 188Using Common Terminal Operations 189Using Common Intermediate Operations 196Putting Together the Pipeline 200Printing a Stream 204Working with Primitives 205Creating Primitive Streams 205Using Optional with Primitive Streams 208Summarizing Statistics 210Learning the Functional Interfaces for Primitives 210Working with Advanced Stream Pipeline Concepts 213Linking Streams to the Underlying Data 213Chaining Optionals 214Collecting Results 217Summary 223Exam Essentials 224Review Questions 226Chapter 5 Dates, Strings, and Localization 233Working with Dates and Times 234Creating Dates and Times 235Manipulating Dates and Times 241Working with Periods 244Working with Durations 247Accounting for Daylight Savings Time 251Reviewing the String class 253Adding Internationalization and Localization 255Picking a Locale 256Using a Resource Bundle 258Formatting Numbers 267Formatting Dates and Times 270Summary 273Exam Essentials 274Review Questions 276Chapter 6 Exceptions and Assertions 283Reviewing Exceptions 284Exceptions Terminology 284Categories of Exceptions 285Exceptions on the OCP 286Try Statement 288Throw vs. Throws 289Creating Custom Exceptions 289Using Multi-catch 291Using Try-With-Resources 296Try-With-Resources Basics 298AutoCloseable 300Suppressed Exceptions 302Putting It Together 305Rethrowing Exceptions 305Working with Assertions 308The assert Statement 308Enabling Assertions 309Using Assertions 310Summary 314Exam Essentials 315Review Questions 316Chapter 7 Concurrency 325Introducing Threads 327Distinguishing Thread Types 328Understanding Thread Concurrency 328Introducing Runnable 330Creating a Thread 331Polling with Sleep 334Creating Threads with the ExecutorService 335Introducing the Single-Thread Executor 335Shutting Down a Thread Executor 337Submitting Tasks 338Waiting for Results 340Scheduling Tasks 345Increasing Concurrency with Pools 348Synchronizing Data Access 350Protecting Data with Atomic Classes 352Improving Access with Synchronized Blocks 354Synchronizing Methods 356Understanding the Cost of Synchronization 357Using Concurrent Collections 358Introducing Concurrent Collections 358Understanding Memory Consistency Errors 359Working with Concurrent Classes 360Obtaining Synchronized Collections 365Working with Parallel Streams 366Creating Parallel Streams 366Processing Tasks in Parallel 367Processing Parallel Reductions 372Managing Concurrent Processes 377Creating a CyclicBarrier 377Applying the Fork/Join Framework 381Identifying Threading Problems 387Understanding Liveness 387Managing Race Conditions 391Summary 392Exam Essentials 393Review Questions 394Chapter 8 IO 405Understanding Files and Directories 406Conceptualizing the File System 406Introducing the File Class 407Introducing Streams 411Stream Fundamentals 411Stream Nomenclature 412Common Stream Operations 418Working with Streams 420The FileInputStream and FileOutputStream Classes 420The FileReader and FileWriter classes 424The ObjectInputStream and ObjectOutputStream Classes 426The PrintStream and PrintWriter Classes 432Review of Stream Classes 435Interacting with Users 437The Old Way 437The New Way 438Summary 442Exam Essentials 443Review Questions 445Chapter 9 NIO.2 453Introducing NIO.2 454Introducing Path 455Creating Paths 456Interacting with Paths and Files 460Providing Optional Arguments 461Using Path Objects 462Interacting with Files 471Understanding File Attributes 478Discovering Basic File Attributes 478Improving Access with Views 483Presenting the New Stream Methods 487Conceptualizing Directory Walking 487Walking a Directory 488Searching a Directory 490Listing Directory Contents 491Printing File Contents 492Comparing Legacy File and NIO.2 Methods 494Summary 495Exam Essentials 495Review Questions 497Chapter 10 JDBC 505Introducing Relational Databases and SQL 507Identifying the Structure of a Relational Database 508Writing Basic SQL Statements 510Introducing the Interfaces of JDBC 511Connecting to a Database 513Building a JDBC URL 513Getting a Database Connection 515Obtaining a Statement 518Choosing a ResultSet Type 519Choosing a ResultSet Concurrency Mode 520Executing a Statement 520Getting Data from a ResultSet 524Reading a ResultSet 524Getting Data for a Column 526Scrolling ResultSet 529Closing Database Resources 533Dealing with Exceptions 535Summary 536Exam Essentials 537Review Questions 539Appendix A Answers to Review Questions 547Chapter 1: Advanced Class Design 548Chapter 2: Design Patterns and Principles 550Chapter 3: Generics and Collections 553Chapter 4: Functional Programming 556Chapter 5: Dates, Strings, and Localization 558Chapter 6: Exceptions and Assertions 560Chapter 7: Concurrency 561Chapter 8: IO 565Chapter 9: NIO.2 568Chapter 10: JDBC 571Appendix B Study Tips 575Studying for the Test 576Creating a Study Plan 576Comparing Previous Exams 578Creating and Running Sample Applications 579Taking the Test 582Understanding the Question 582Taking Advantage of the Exam Software 587Using the Provided Writing Material 587Choosing the Best Answer 590Optimizing Your Time 591Getting a Good Night’s Rest 593Appendix C Upgrading from Java 6 or Earlier 595Enhancing the Java Language 596Using the Diamond Operator 596Creating Literals 597Making Decisions with Switch 598Formatting and Parsing 603Using DecimalFormat Flags 603Using DateFormat 603Formatting 604Parsing 605Custom Date Formats 606Applying Locks 607Understanding the Lock Framework 607Using a ReentrantLock 610Understanding Read/Write Locks 614Using a ReentrantReadWriteLock 615Working with Directories 617Traversing Directories 618Monitoring a Directory for Changes 625Summary 633Exam Essentials 633Review Questions 635Answers to Practice Test 645Index 649