Logic & Loops
Methods
Arrays & File I/O
Keywords
OOP Concepts
100

What does '(6 > 7 || -34 < 10) && 45 < 90' evaluate to?

true

100

Where can I access variables that are defined in a method?

Variables defined within a method can only be accessed from within the scope of that method.

100

What is the last index for an array that has a size of 10?

9

100

Indicates that a method does not return anything.

What is the void keyword?

100

What is the difference between the 'this' keyword and the 'super' keyword?

'this' is used to refer to fields and methods of the current class. 'super' is used to refer to fields and methods of the parent class.

200
What are the two ways we can check for equality in an if statement and what are each used for?

==: used for primitive data types

.equals(): used for objects (more specifically Strings)

200

List the components required to write a method header.

access modifier, return type, method name, parameters (data type and name)

200

Why does the memory address get printed out when we try to print an array?

This happens because arrays are objects.

200

Indicates that the method or variable can be accessed from anywhere (including outside the current class)

What is the public keyword?

200

What is encapsulation?

The concept of protecting our class data from unchecked modification. This involves marking our variables as private and creating getters and setters for controlled access.

300

Name the four major loop variations in Java.

while loop, do-while loop, for loop, for-each loop

300

What does it mean to overload a method?

Overloading describes the concept that we can have multiple methods with the same name, provided that they take in parameters of different datatypes.

300

If I create a two-dimensional array of integers, what am I actually storing in that array?

A two-dimensional array is an array of references. Each reference points to an array of integers.

300

Indicates an inheritance relationship between two classes

What is the extends keyword?

300

What is a constructor and when is it called?

The constructor is a special method used to initialize data for the class that is called when an object is created.

400

What are some uses for nested loops?

Nested loops are ideal for working with multidimensional data. They are also useful for multidimensional arrays.

400

What does it mean to override a method?

Overriding occurs when we rewrite a method from a parent class in the child class. Both of these methods have the exact same method header.

400

What is the difference between an absolute and relative file path?

The absolute path is the entire path from the root directory. It is more specific but less portable. The relative path is specified from the default working directory and therefore, is more portable.

400

Indicates that a variable has a constant, never-changing value

What is the final keyword?

400

What is the difference between a class and an object?

An object is an instance (or version) of the class. There can be many objects of the same class.

500

Briefly describe the three parts of a standard for loop.

The variable initialization, the loop conditional, and the iteration step (update).

500

What are the important implications of passing an object into a method (or returning the object)?

When an object reference is passed into or returned from a method, pass by reference occurs. This means that the reference is not copied but passed directly. If the object is passed into the method, the method can modify the object directly. If the object is returned, the caller of the method can modify the object directly.

500

Describe how Java File I/O utilizes a buffer and file handle.

The OS creates an area in memory (a buffer) that the program can access. Assuming the program has the proper permissions, the contents of the file are copied to the buffer. Then the OS provides the program with a reference to the buffer (a file handle), so the program can indirectly access/modify the file contents.

500

Indicates that the method or variable does not require an object to be created for it to be accessed

What is the static keyword?

500

Why is polymorphism?

Polymorphism is the idea that a child class can be referred to by the type of any of its parent classes. For example, if a method took in the type 'Object', any object could be passed into that method because they all inherit from the Object class.

M
e
n
u