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

IST CodeHS Unit 2 Robot Coding Review

IST CodeHS Unit 2 Robot Coding Review

9th - 12th Grade

20 Qs

uCertify JavaScript Chapter 5

uCertify JavaScript Chapter 5

9th - 12th Grade

20 Qs

CodeHS AP CSP Unit 3 Review

CodeHS AP CSP Unit 3 Review

11th - 12th Grade

22 Qs

JavaScript - Karel

JavaScript - Karel

9th - 10th Grade

20 Qs

CodeHS JavaScript

CodeHS JavaScript

8th - 12th Grade

21 Qs

JAVA FUNDAMENTALS

JAVA FUNDAMENTALS

9th - 12th Grade

20 Qs

Java Programming Quiz unit 3

Java Programming Quiz unit 3

12th Grade

21 Qs

JavaScript Basics CodeHS

JavaScript Basics CodeHS

7th - 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 Cabrera

Used 6+ 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?