Constructors
Methods
Classes
Arrays/MD Arrays
Inheritance
100

What is the purpose of a copy constructor?

To instantiate a new object by initializing its fields (aka instance variables) to the values of another object (of the same type)

100

What is the purpose of the equals() method?

Compares the member variables of two objects for equality

100

What are the three different type of constructors?

Parameterized, copy, default constructors

100

How would you correctly declare an integer array named numbers with 50 elements?

int[ ] numbers = new int[50];

100

What is inherited by a subclass?

protected and public instance variables and methods

200

What is the purpose of a default constructor?

To instantiate a new object by initializing its fields (aka instance variables) to null or default values.

200

What is the purpose of the toString() method?

Converts the object into a String for display

200

What is the difference between an object and a class?

Objects are an instance of a class, classes are "Blueprints" of an object

200

What is an index?

An index refers to a certain position in the array

200

What does the keyword extends do?

extends is used to state that the class is inheriting from a parent class

300

What is the purpose of a parameterized constructor?

To instantiate a new object by initializing its fields (instance variables) with the arguments coming into the constructor

300

What does Setters/Getter methods do?

Setters: Setter methods changes the value of one of the fields.

Getters: Getter methods return the value of one of the fields.

300

What methods does each class typically contain?

Constructors,Getters and Setters,Equals() and toString().

300

What is an element?

An element refers to the value at a certain position in the array.

300

What does the keyword super do?

super is used to refer methods in the parent class

400

True or False: A class in Java can have more than one constructor?

True

400

True or False: Getter methods should have the return type of "void"

False

400

What is class composition in Object Oriented Programming?

When a class references one or more objects of other classes in member variables (aka fields)

400

What does the .length property do?

it returns how many indices are within the array.

400

True or False: A parent class can inherit fields and methods from the child class

False

500

Create a Parameterized for the following class:

public class Computer { 

private double mCPU; 

private int mRAM; 

private String mModel;

 }

Public Computer(double cpu, int ram, String model){

mCpu = cpu;

mRam = ram;

mModel = model

}

500

In the Quiz class, the displayStats method has the following signature: public static void displayStats(int numGrades). How would you use the displayStats method?

Quiz.displayStats(parameter);

500

What are 3 access modifiers? What does each of them do?

Public-Classes, methods and fields are  accessible from every where in the program.

Private- The methods and fields are accessible only within the class in which they are declared.

Protected-The methods and fields are accessible within same package or in child classes

500

Which loop is used to iterate through all the contents of a two-dimensional array?

nested for loops

500

What class does every class inherit from?

The Object class