You are previewing Oracle Certified Associate, Java SE 7 Programmer Study Guide.
O'Reilly logo
Oracle Certified Associate, Java SE 7 Programmer Study Guide

Book Description

This book is designed specifically to prepare you for the Oracle Certified Associate, Java SE 7 Programmer Certification exam (1Z0-803). Totally focused and user-friendly, it provides all the essential theoretical and practical skills required.

  • In-depth understanding of Java through the examination of objects and methods

  • Extensive code examples and figures to illustrate key concepts in Java SE 7 including memory usage

  • Additional coverage of good programming and design practices as they relate to the certification objectives

  • Step-by-step coverage of certification exam topics in a simplified and easy-to-learn manner

  • In Detail

    Java SE 7 Associate Programmer certification adds to your qualification as a Java developer. Knowledge of Java is important, but knowing how to write an efficient and productive code adds to your skills and gives you an edge when you are planning to give the certification exam. Coverage of the objectives goes beyond a simple review of certification objectives.

    "Oracle Certified Associate, Java SE 7 Programmer Study Guide" addresses certification exam objectives and provides discussion and examples to show the best ways of applying Java language features in real world programming. You will gain in-depth understanding of Java by examining how objects are allocated in the heap and how methods are managed in the program stack.

    "Oracle Certified Associate, Java SE 7 Programmer Study Guide" covers all of the Java SE 7 Associate Programmer certification objectives. It starts with a high level overview of an application’s structure to provide a framework for subsequent chapters. Chapters are organized around common themes with emphasis on memory usage. You will get an in-depth and complete understanding of the run-time Java environment using the illustrations that show the impact of class and method usage on the program stack and heap.

    Augmenting the coverage of certification objectives are examples of how you can use the classes, methods, and techniques in a productive and sound manner. In addition, sample exam questions are given in each chapter.

    Table of Contents

    1. Oracle Certified Associate, Java SE 7 Programmer Study Guide
      1. Table of Contents
      2. Oracle Certified Associate, Java SE 7 Programmer Study Guide
      3. Credits
      4. About the Author
      5. About the Reviewers
      6. www.PacktPub.com
        1. Support files, eBooks, discount offers and more
          1. Why Subscribe?
          2. Free Access for Packt account holders
          3. Instant Updates on New Packt Books
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code
          2. Errata
          3. Piracy
          4. Questions
      8. 1. Getting Started with Java
        1. Understanding Java as a technology
          1. Object-oriented software development
          2. OOP principles
          3. Examining the types of Java applications
        2. Exploring the structure of a Java console program
          1. A simple Java application
            1. Package
            2. Import
            3. The Customer class
            4. Instance variables
            5. Methods
            6. The CustomerDriver class' main method
        3. Exploring the structure of a class
          1. Classes, interfaces, and objects
            1. Classes and objects
            2. Constructors
            3. Interfaces
          2. Methods
            1. Method declaration
            2. Method signature
            3. The main method
              1. Returning a value from an application
          3. Access modifiers
          4. Documentation
            1. Comments
            2. Java naming conventions
            3. Using Javadocs
        4. Investigating the Java application development process
          1. Compiling a Java application
          2. SDK file structure
          3. IDE file structure
          4. Developing Java applications without an IDE
          5. Java environment
          6. Annotations
          7. Java class libraries
        5. Summary
        6. Certification objectives covered
        7. Test your knowledge
      9. 2. Java Data Types and Their Usage
        1. Understanding how Java handles data
          1. Java identifiers, objects, and memory
          2. Stack and heap
          3. Declaring a variable
          4. Primitive data types
          5. Wrapper classes and autoboxing
          6. Initializing identifiers
          7. Java constants, literals, and enumerations
            1. Literals
              1. Numeric literals
              2. Character literals
              3. String literals
            2. Constants
            3. The final keyword
            4. Enumerations
            5. Immutable objects
          8. Instance versus static data
          9. Scope and lifetime
            1. Scoping rules
          10. Access modifiers
          11. Data summary
        2. Building expressions using operands and operators
            1. Precedence and associativity
            2. Casting
        3. Working with characters and strings
            1. The String, StringBuffer, and StringBuilder classes
            2. Unicode characters
          1. The Character class
            1. The Character class – methods
          2. The String class
            1. String comparisons
            2. Basic string methods
            3. String length
            4. Number/string conversions
            5. Miscellaneous String methods
          3. The StringBuffer and StringBuilder classes
        4. Summary
        5. Certification objectives covered
        6. Test your knowledge
      10. 3. Decision Constructs
        1. Flow of control
          1. Control statement – an overview
        2. Logical expressions
          1. Boolean variables
          2. The equality operator
          3. Relational operators
          4. Logical operators
          5. Short circuit evaluation
            1. Using the && operator
            2. Using the || operator
            3. Avoiding short circuit evaluation
        3. The if statement
          1. Nested if statements
          2. The else-if variation
          3. The if statement – usage issues
            1. Misusing the equality operator
            2. Using inverse operations
            3. Using Boolean variables instead of logical expressions
            4. Using true or false in a logical expression
            5. The perils of not using the block statement
            6. The dangling else problem
        4. Conditional operator
        5. The switch statement
          1. Integer-based switch statements
          2. Enumeration-based switch statements
          3. String-based switch statements
            1. String issues with the switch statement
        6. Control structure issues
          1. General decision constructs issues
          2. Floating point number considerations
            1. Special floating point values
            2. Comparing floating point numbers
            3. Rounding errors
            4. The strictfp keyword
          3. Comparing objects
          4. Three basic coding activities
          5. The goto statement
        7. Summary
        8. Certification objectives covered
        9. Test your knowledge
      11. 4. Using Arrays and Collections
        1. Arrays
          1. One-dimensional arrays
            1. The placement of array brackets
            2. Initializing arrays
          2. Arrays of objects
          3. Multidimensional arrays
          4. Array techniques
            1. Traversing arrays
              1. Using simple loops
              2. Using the for-each statement
            2. Comparing arrays
              1. Element-by-element comparison
              2. Using the equality operator
              3. Using the equals method
              4. Using the deepEquals method
            3. Copying arrays
              1. Simple element-by-element copy
              2. Using the System.arraycopy method
              3. Using the Arrays.copyOf method
              4. Using the Arrays.copyOfRange method
              5. Using the clone method
            4. Passing arrays
            5. Using command-line arguments
          5. The Arrays class
          6. Key points to remember when using arrays
        2. Collections
          1. Iterators
          2. ArrayList
            1. Creating ArrayList
            2. Adding elements
            3. Retrieving elements
            4. Traversing a ArrayList object
            5. Sorting a ArrayList object
            6. Other ArrayList methods
          3. Encapsulating collections
        3. Summary
        4. Certification objectives covered
        5. Test your knowledge
      12. 5. Looping Constructs
        1. The for statement
          1. The comma operator
          2. The for statement and scope
          3. The for loop variations
        2. The for-each statement
          1. Using the for-each statement with a list
          2. Implementing the Iterator interface
          3. The for-each statement – usage issues
            1. Null values
            2. Variable number of arguments
        3. The while statement
        4. The do-while statement
        5. The break statement
        6. The continue statement
        7. Nested loops
        8. Using labels
        9. Infinite loops
        10. Timing is everything
        11. Pitfalls
        12. Summary
        13. Certification objectives covered
        14. Test your knowledge
      13. 6. Classes, Constructors, and Methods
        1. Classes
          1. Object creation
          2. Memory management
          3. Data encapsulation
          4. Referencing instance variables
          5. Signature
        2. Using the this keyword
          1. Passing parameters
            1. Variable number of arguments
          2. Immutable objects
        3. Constructors
          1. Default constructors
          2. Overloading the constructors
          3. Private constructors
          4. Constructor issues
          5. Java initialization sequence
        4. Methods
          1. Defining methods
          2. Calling methods
          3. Overloading methods
          4. Accessors/mutators
        5. Instance and static class members
        6. Summary
        7. Certification objectives covered
        8. Test your knowledge
      14. 7. Inheritance and Polymorphism
        1. Inheritance
          1. Implementing a subclass
          2. Using the protected keyword
          3. Overriding methods
          4. The @Override annotation
          5. Using the final keyword with classes
          6. Abstract methods and classes
        2. Polymorphism
        3. Managing classes and objects
          1. The super keyword and constructors
            1. Calling a base class constructor
            2. Accessing an overridden method in the base class
          2. Determining the type of an object
          3. The Object class
          4. Casting objects
          5. A review of scope
        4. Summary
        5. Certification objectives covered
        6. Test your knowledge
      15. 8. Handling Exceptions in an Application
        1. Exception types
        2. Exception handling techniques in Java
          1. Stack trace
          2. Using Throwable methods
        3. The traditional try-catch block
        4. Using the try-with-resource block
        5. Catch statement
          1. Order of the catch blocks
          2. Using the | operator in a catch block
        6. The finally block
        7. Nested try-catch blocks
        8. Exception handling guidelines
          1. Repeating code that threw an exception
          2. Not being specific in which exception you are catching
          3. Losing the stack trace
          4. Scoping and block lengths
          5. Throwing a UnsupportedOperationException object
          6. Ignoring exceptions
          7. Handle exceptions as late as you can
          8. Catching too much in a single block
          9. Logging exceptions
          10. Do not use exceptions to control normal logic flow
          11. Do not try to handle unchecked exceptions
        9. Summary
        10. Certification objectives covered
        11. Test your knowledge
      16. 9. The Java Application
        1. Code organization
          1. Packages
          2. The directory/file organization of packages
          3. The import statement
            1. Avoiding the import statement
            2. Using the import statement
            3. Using the wildcard character
            4. Multiple classes with the same name
            5. The static import statement
          4. Garbage collection
        2. Resource bundles and the Locale class
          1. Using the Locale class
          2. Using resource bundles
            1. Using a property resource bundle
            2. Using the ListResourceBundle class
        3. Using JDBC
          1. Connecting to a database
            1. Loading a suitable driver
            2. Establishing a connection
          2. Creating a SQL statement
          3. Handling the results
        4. Summary
        5. Certification objectives covered
        6. Test your knowledge
      17. A. Test Your Knowledge – Answers
        1. Chapter 1: Getting Started with Java
        2. Chapter 2: Java Data Types and Their Usage
        3. Chapter 3: Decision Constructs
        4. Chapter 4: Using Arrays and Collections
        5. Chapter 5: Looping Constructs
        6. Chapter 6: Classes, Constructors, and Methods
        7. Chapter 7: Inheritance and Polymorphism
        8. Chapter 8: Handling Exceptions in an Application
        9. Chapter 9: The Java Application
      18. Index