Search Header Logo

AP CSA (Java) 1.1-1.4 Practice Questions

Authored by Yanet Gagliotti

Computers

9th - 12th Grade

Used 10+ times

AP CSA (Java) 1.1-1.4 Practice Questions
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

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.

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?