AP CSA (Java) 1.1-1.4 Practice Questions

AP CSA (Java) 1.1-1.4 Practice Questions

9th - 12th Grade

25 Qs

quiz-placeholder

Similar activities

Mine craft

Mine craft

5th - 9th Grade

20 Qs

Javascript Conditional Statements

Javascript Conditional Statements

9th - 12th Grade

20 Qs

Java Primitive Data Types practice quiz 2025

Java Primitive Data Types practice quiz 2025

11th Grade

25 Qs

Mock Test UPS1

Mock Test UPS1

12th Grade

20 Qs

Java Arrays

Java Arrays

9th - 12th Grade

20 Qs

Python drill 2

Python drill 2

7th - 9th Grade

20 Qs

Python Conditionals Practice

Python Conditionals Practice

9th - 12th Grade

20 Qs

Python Text Files

Python Text Files

12th Grade

20 Qs

AP CSA (Java) 1.1-1.4 Practice Questions

AP CSA (Java) 1.1-1.4 Practice Questions

Assessment

Quiz

Computers

9th - 12th Grade

Easy

Created by

Yanet Gagliotti

Used 9+ times

FREE Resource

25 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will this code segment output?

Media Image
Media Image
Media Image
Media Image

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which code segment will print “Hello Karel” to the screen in Java?

System.out.printLine("Hello Karel");

print "Hello Karel";

System.out.println("Hello Karel");

System.println("Hello Karel");

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will this code segment output?

This won’t print anything.

Media Image

It will only print the first line as ***** since only one print statement can be used.

Media Image

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax for writing the main method in Java?

Media Image
Media Image
Media Image
Media Image

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a proper way to declare and initialize a variable in Java?

Media Image
Media Image
Media Image
Media Image

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Consider the following code snippet. What value of z is actually printed?

20

30

This code gives an error.

Nothing is printed.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What are the memory values associated with the variables x, y, and z after the code snippet below executes?

x holds the int value 7, y holds the double value 2.0 and z holds the boolean value false.

x holds the int value 10, y holds the double value 2.0 and z holds the boolean value true.

This code snippet will result in a compile time error.

x holds the int value 10, y holds the double value 2.0 and z holds the boolean value false.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?