Allows a method to return nothing.
What is void?
The symbol that represents public visibility.
What is +?
Keyword to immediately exit a loop.
What is break?
Having two methods with the same name but different parameters.
What is method overloading?
Computer wants to use Device, which is an interface. Write the class header/declaration for Computer.
public class Computer implements Device {}
Refers to the current object inside a class.
What is this?
Used to indicate abstract methods.
What is italics?
All classes inherit from this.
What is Object?
What is a constructor?
Check if two string objects have the same value.
What is stringA.equals(stringB)?
Defines a constant.
What is final?
This symbol represents protected visibility.
What is #?
Symbol used to access fields/methods of an object.
What is .?
Method that usually returns a private field.
What is an accessor?
for(int i = 0; i < 5; i++)
System.out.println(i)
The error is...
What is a missing semicolon?
Used to define a method/variable that belongs to the class, not the object.
What is static?
Constructor notation.
What is <<create>>?
This checks shallow equality.
What is ==?
Two methods with the same name, same parameters, but different classes.
What is method overriding?
Declare an array of integers with size 5.
int[] arr = new int[5];
A class state declared without an access modifier implies this state (and list the entities that have access to it in this case).
Package protected
-> all instances of the class
-> classes in the same package
Used to indicate an inheritance (parent-child) relationship between two classes.
What is a solid line with an empty triangle (child -> parent)
System.out.println(4 + 7 + "7");
What does it print?
477
What is toString?
Write a method that adds up all the elements in an array and returns the sum.
public int arrayTotal(int[] arr) {
int sum = 0;
for (int i = 0; i < arr.length; i++) {
sum += arr[i];
}
return sum;
}