CodeHS Java Level 1 (CHS-J1) Exam Prep
Free practice questions

Free CHS-J1 Practice Questions

10 exam-style questions with answers and explanations, straight from our 1,030-question bank. Tap an answer to check yourself. When you're ready, take the scored version in the free practice test.

Start the free practice test → ★★★★★4.9/5 from 2,400+ candidates · No signup

The CHS-J1 exam has 45 questions and runs 1 hours 30 minutes.

These 10 free CHS-J1 questions are organized by exam domain, so you can see how each part of the CodeHS Java Level 1 (CHS-J1) blueprint is tested. Reveal the answer and explanation under each question.

Domain 1: Java Fundamentals: Perform basic input and output using standard packages (including scanner); Evaluate the scope of a variable

Question 1

A Java program uses Scanner to read a user's age. Which statement correctly creates a Scanner object that reads from standard input?

Show answer & explanation

Correct answer: A - Scanner input = new Scanner(System.in);

Question 2

A method declares an int variable named total inside its body. Another method in the same class attempts to use total directly. What is the most accurate explanation?

Show answer & explanation

Correct answer: B - The variable is only accessible within the method where it is declared

Domain 2: Working with Data Types, Variables, and Expressions: Understanding primitive variables including casting and arithmetic operations; Strings and string methods including parsing; Arrays - creating, manipulating, and traversing; ArrayLists - creating, manipulating, and traversing; 2D Arrays - creating, manipulating, and traversing

Question 3

What value is stored in result after this code executes? int a = 7; double result = a / 2;

Show answer & explanation

Correct answer: B - 3.0

Question 4

A programmer wants to convert the String value "42" into an integer before performing arithmetic. Which approach is appropriate?

Show answer & explanation

Correct answer: A - Integer.parseInt("42")

Question 5

A program contains an ArrayList of student names. The programmer needs to examine every name without changing the list. Which approach best matches this task?

Show answer & explanation

Correct answer: B - Use traversal that visits each element in sequence

Question 6

A two-dimensional int array is declared as int[][] scores = new int[3][4]; What does this declaration create?

Show answer & explanation

Correct answer: A - Three rows and four columns of integer storage

Domain 3: Implement Flow Control: Boolean Expressions including understanding and evaluating logic expressions; Iterations and Loops including for loops, for-each loops, and while loops

Question 7

A programmer writes if (x > 5 && x < 10). For which value of x will the condition evaluate to true?

Show answer & explanation

Correct answer: C - 7

Question 8

What is printed by this loop? for (int i = 1; i <= 3; i++) { System.out.print(i); }

Show answer & explanation

Correct answer: A - 123

Question 9

A developer needs a loop that continues running as long as a user's input remains valid, but the number of repetitions is unknown before execution. Which loop is most appropriate?

Show answer & explanation

Correct answer: A - A while loop controlled by the validity condition

Domain 4: Perform Object-Oriented Programming: Creating and using objects; Writing classes, including methods, instance variables, and static methods; Recognizing class hierarchies and inheritance; excludes implementing inheritance, polymorphism, abstract classes, and interfaces

Question 10

A class named Book has an instance variable title and a static variable totalBooks. Which statement is correct?

Show answer & explanation

Correct answer: C - title can differ between objects while totalBooks is shared by the class

The rest of the CHS-J1 blueprint

The CHS-J1 exam also covers these domains. Drill them in the full free practice test:

That's 10 of 1,030

The full bank has 1,020 more CHS-J1 questions with explanations.

Continue in the free practice test →

View plans