Introduction to Programming
Control Structures
Introduction to OOP
Data Structures
Random Questions
100

What does javac do?

The command that compiles the code into a class file.

100

What is an arithmetic operator in Java?

Arithmetic operators are used to perform basic mathematical operations.
100

What is OOP?

A programming paradigm based on objects and data.

100

What are data structures?

A specialized way of organizing data.
100

How do you explicitly destroy an object in Java?

object = null;

System.gc();

200

What does the java command do?

java followed by the filename is used to execute the java program. 

200

Which are the relational operators in Java and what do they do?

They are used to compare two values. == (Equal), != (Not Equal), < (Less than), > (Greater than), <=, >=

200

What is the difference between a strongly typed and loosely typed programming language?

For Strongly Typed, variables can only store one type of data. Loosely typed can store any data at any point.

200

Name three examples of data structures in Java?

Arrays, ArrayLists, HashMaps
200

What is a constructor?

A method that allows for object creation with specific attribute values being assigned.

300

What is a variable?

A variable is a reserved memory location used to store information.

300

Which control structure is used to make decisions based on conditions?

The if-else control structure.

300

What's the difference between a Class and an Object?

A class is the blueprint that dictates how an object is dictated.
300

Why is prototyping used in ArrayLists or HashMaps?

To determine which kind of objects a data structure will contain.

300

Which part of a method or function determines which variables should be use to invoke it?

The method signature.

400

Name three data types for variables?

int, char, boolean, String, float, etc...

400

What are the three sections in the for loop?

initialization; condition; update

400

How do you instantiate a class named Student?

Student theStudent = new Student();

400

What method is used to add items to an ArrayList?

arrayList.add(item);

400

What is the use of the return keyword inside of a function?

It allows for communicating a return value between methods.

500

What's the difference between Integer and int?

One is a class (Integer) the other is a primitive type.

500

Which cicle is designed to guarantee at least one iteration?

The do-while loop.

500

What are the two main components of a class?

Attributes and Methods

500

Declare an array of 5 numbers and then invert the array by using a for loop.

int[] numbers = {1, 2, 3, 4, 5};

int[] temporary = {0, 0, 0, 0, 0};

for(int i=0; i<5; i++) {

    temporary[5-1-i] = numbers[i];

}

numbers = temporary;

500

What is the garbage collector?

The mechanism that Java uses to dispose of unused references or orphaned objects.

M
e
n
u