Chapter 2Working with Java Data Types

THE OCA EXAM TOPICS COVERED IN THIS PRACTICE TEST INCLUDE THE FOLLOWING:

  • Working with Java Data Types
    • Declare and initialize variables (including casting of primitive data types)
    • Differentiate between object reference variables and primitive variables
    • Know how to read or write to object fields
    • Explain an Object’s Lifecycle (creation, “dereference by reassignment” and garbage collection)
    • Develop code that uses wrapper classes such as Boolean, Double, and Integer
  1. Which of the following declarations does not compile?

    1. double num1, int num2 = 0;
    2. int num1, num2;
    3. int num1, num2 = 0;
    4. int num1 = 0, num2 ...

Get OCA / OCP Java SE 8 Programmer Practice Tests now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.