wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

APCSA Unit 1 Review

Total questions: 20

Worksheet time: 13mins

Name
Class
Date
1.

Which one is correct?

a)

public static main(Strings[] args) { }

b)

public private static main(Strings[] args) { }

c)

public static void main(Strings[] args) { }

d)

public void static main(Strings[] args) { }

2.

What data type would you use for storing the number of students in a class?

a)

boolean

b)

char

c)

int

d)

double

3.

What is a variable?

a)

A storage location of memory which can change

b)

A random area to store things in.

c)

Something that changes

d)

Something that can only store numbers

4.

(=) sign means

a)

equals and it is used for math problems in Java

b)

assignment operator. It used to assign a value

5.

Consider the following code segment.


System.out.println("W");

System.out.println("X");

System.out.print("Y");

System.out.print("Z");


What is printed as a result of executing the code segment?

a)

WXYZ

b)

W

XYZ

c)

WX

YZ

d)

W

X

YZ

e)

W

X

Y

Z

6.

What is the correct syntax for creating a string in Java?

a)

string = "text;"

b)

String = "text"

c)

String = 'text':

d)

String = "text";

7.

What is a method?

a)

a tool that makes a program longer

b)

a tool that helps organize behaviors in a program

c)

a tool that makes a program more disorganized

d)

a tool that makes a program harder to read

e)

a tool that complicates a program

8.
How do you make an instance of the Animal class?
a)
Animal anim = new Animal();
b)
Animal = new Animal();
c)
Animal anim = new Animal;
9.

What do constructors do in Java?

a)

They help to set up objects when they are first created

b)

They allow objects to perform actions

c)

They create classes

10.

What is a class in java?

a)

A template for objects

b)

A room full of chipmunks

c)

A behavior that an object can do

d)

Another name for a variable

11.

What is a package in Java?

a)

A set of related classes and interfaces

b)

The tech gadget that comes in an Amazon box

c)

A group of objects

d)

Another name for a method

12.

How do you call a method named orderUp() from the Chef class using a Chef object called boyardee?

a)

boyardee.orderUp()

b)

orderUp(boyardee)

c)

.orderUp(boyardee)

d)

boyardee.orderUp(boyardee)

13.

Data type for non return method is

a)

int

b)

double

c)

void

d)

public static

14.

What is concatenation?

a)

When strings are linked together using +

b)

When numbers are added together using +

c)

The nation with cats

15.

What happens in memory when you append to a string using +=?

a)

The new part of the string is added next to the old string value

b)

The variable references a whole other location in memory that contains the new, updated string

c)

The variable references a whole other location in memory that contains the new part of the string only

16.

Attributes of an object are also known as

a)

methods

b)

properties

c)

classes

d)

functions

17.

The process by which objects of one class acquire the properties of objects of another class is known as

a)

Polymorphism

b)

Inheritance

c)

Data Hiding

d)

Association

18.
What is the difference between a class and an object?
a)
A class is a blueprint to make an object
b)
An object is a blueprint to make a class
c)
A blueprint is an object to make a class
d)
Blueprint class is an object make a
19.
An object is an instance of a:
a)
parameter
b)
method
c)
class
d)
application
20.

How do you insert COMMENTS in Java code?

a)

# This is a comment

b)

/* This is a comment

c)

// This is a comment