The following table provides a breakdown of this book's exam coverage for the Java Foundations (1Z0-811) exam, showing you the chapter where each objective or subobjective is covered.
Additionally, the objectives may be updated if Oracle updates the Java Foundations exam for a later version of Java. Check our website for those updates as well.
Exam Objective |
Chapter |
What is Java? |
|
Describe the features of Java |
1 |
Describe the real-world applications of Java |
1+ online |
Java Basics |
|
Describe the Java Development Kit (JDK) and the Java Runtime Environment (JRE) |
1 |
Describe the components of object-oriented programming |
1 |
Describe the components of a basic Java program |
1 |
Compile and execute a Java program |
1 |
Basic Java Elements |
|
Identify the conventions to be followed in a Java program |
1 |
Use Java reserved words |
1 |
Use single-line and multi-line comments in Java programs |
1 |
Import other Java packages to make them accessible in your code |
1 |
Describe the java.lang package |
1 |
Working with Java Data Types |
|
Declare and initialize variables including a variable using final |
1 |
Cast a value from one data type to another including automatic and manual promotion |
2 |
Declare and initialize a String variable |
1 |
Working with Java Operators |
|
Use basic arithmetic operators to manipulate data including +, -, *, /, and % |
2 |
Use the increment and decrement operators |
2 |
Use relational operators including ==, !=, >, >=, <, and <= |
2 |
Use arithmetic assignment operators |
2 |
Use conditional operators including &&, ||, and ? |
2 |
Describe the operator precedence and use of parentheses |
2 |
Working with the String Class |
|
Develop code that uses methods from the String class |
4 |
Format Strings using escape sequences including %d, %n, and %s |
11 |
Working with Random and Math Classes |
|
Use the Random class |
Online |
Use the Math class |
4 |
Using Decision Statements |
|
Use the decision making statement (if-then and if-then-else) |
3 |
Use the switch statement |
3 |
Compare how == differs between primitives and objects |
4 |
Compare two String objects by using the compareTo and equals methods |
4 |
Using Looping Statements |
|
Describe looping statements |
3 |
Use a for loop including an enhanced for loop |
3 |
Use a while loop |
3 |
Use a do- while loop |
3 |
Compare and contrast the for, while, and do-while loops |
3 |
Develop code that uses break and continue statements |
3 |
Debugging and Exception Handling |
|
Identify syntax and logic errors |
1, 2, 3 |
Use exception handling |
11 |
Handle common exceptions thrown |
11 |
Use try and catch blocks |
11 |
Arrays and ArrayLists |
|
Use a one-dimensional array |
4 |
Create and manipulate an ArrayList |
9 |
Traverse the elements of an ArrayList by using iterators and loops including the enhanced for loop |
9 |
Compare an array and an ArrayList |
4, 9 |
Classes and Constructors |
|
Create a new class including a main method |
1 |
Use the private modifier |
5 |
Describe the relationship between an object and its members |
6 |
Describe the difference between a class variable, an instance variable, and a local variable |
1, 6 |
Develop code that creates an object's default constructor and modifies the object's fields |
6 |
Use constructors with and without parameters |
6 |
Develop code that overloads constructors |
6 |
Java Methods |
|
Describe and create a method |
5 |
Create and use accessor and mutator methods |
5 |
Create overloaded methods |
5 |
Describe a static method and demonstrate its use within a program |
5 |
Use the following assessment test to gauge your current level of skill in Java for the 1Z0-829. This test is designed to highlight some topics for your strengths and weaknesses so that you know which chapters you might want to read multiple times. Even if you do well on the assessment test, you should still read the book from cover to cover, as the real exams are quite challenging.
1 What is the result of executing the following code snippet?41: final int score1 = 8, score2 = 3; 42: char myScore = 7; 43: var goal = switch (myScore) { 44: default -> {if(10>score1) yield "unknown";} 45: case score1 -> "great"; 46: case 2, 4, 6 -> "good"; 47: case score2, 0 -> {"bad";} 48: }; 49: System.out.println(goal);unknowngreatgoodbadunknowngreatgoodbadExactly one line needs to be changed for the code to compile.Exactly two lines need to be changed for the code to compile.None of the above
2 What is the output of the following code snippet?int moon = 9, star = 2 + 2 * 3; float sun = star>10 ? 1 : 3; double jupiter = (sun + moon) - 1.0f; int mars = --moon <= 8 ? 2 : 3; System.out.println(sun+", "+jupiter+", "+mars);1, 11, 23.0, 11.0, 21.0, 11.0, 33.0, 13.0, 33.0f, 12, 2The code does not compile because one of the assignments requires an explicit numeric cast.
3 Which changes, when made independently, guarantee the following code snippet prints 100 at runtime? (Choose all that apply.)List data = new ArrayList<>(); IntStream.range(0,100).parallel().forEach(s -> data.add(s)); System.out.println(data.size());Change data to an instance variable and mark it volatile.Remove parallel() in the stream operation.Change forEach() to forEachOrdered() in the stream operation.Change parallel() to serial() in the stream operation.Wrap the lambda body with a synchronized block.The code snippet will always print 100 as is.
4 What is the output of this code?20: Predicate empty = String::isEmpty; 21: Predicate notEmpty = empty.negate(); 22: 23: var result = Stream.generate(() -> "") 24: .filter(notEmpty) 25: .collect(Collectors.groupingBy(k -> k)) 26: .entrySet() 27: .stream() 28: .map(Entry::getValue) 29: .flatMap(Collection::stream) 30: .collect(Collectors.partitioningBy(notEmpty)); 31: System.out.println(result);It outputs {}.It outputs {false=[], true=[]}.The code does not compile.The code does not terminate.