NEW
Font size
WorksheetsAPCSA Unit 1 Review
Total questions: 20
Worksheet time: 13mins
Which one is correct?
public static main(Strings[] args) { }
public private static main(Strings[] args) { }
public static void main(Strings[] args) { }
public void static main(Strings[] args) { }
What data type would you use for storing the number of students in a class?
boolean
char
int
double
What is a variable?
A storage location of memory which can change
A random area to store things in.
Something that changes
Something that can only store numbers
(=) sign means
equals and it is used for math problems in Java
assignment operator. It used to assign a value
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?
WXYZ
W
XYZ
WX
YZ
W
X
YZ
W
X
Y
Z
What is the correct syntax for creating a string in Java?
string = "text;"
String = "text"
String = 'text':
String = "text";
What is a method?
a tool that makes a program longer
a tool that helps organize behaviors in a program
a tool that makes a program more disorganized
a tool that makes a program harder to read
a tool that complicates a program
What do constructors do in Java?
They help to set up objects when they are first created
They allow objects to perform actions
They create classes
What is a class in java?
A template for objects
A room full of chipmunks
A behavior that an object can do
Another name for a variable
What is a package in Java?
A set of related classes and interfaces
The tech gadget that comes in an Amazon box
A group of objects
Another name for a method
How do you call a method named orderUp() from the Chef class using a Chef object called boyardee?
boyardee.orderUp()
orderUp(boyardee)
.orderUp(boyardee)
boyardee.orderUp(boyardee)
Data type for non return method is
int
double
void
public static
What is concatenation?
When strings are linked together using +
When numbers are added together using +
The nation with cats
What happens in memory when you append to a string using +=?
The new part of the string is added next to the old string value
The variable references a whole other location in memory that contains the new, updated string
The variable references a whole other location in memory that contains the new part of the string only
Attributes of an object are also known as
methods
properties
classes
functions
The process by which objects of one class acquire the properties of objects of another class is known as
Polymorphism
Inheritance
Data Hiding
Association
How do you insert COMMENTS in Java code?
# This is a comment
/* This is a comment
// This is a comment
