Java Basics
Object-Oriented Programming
Inheritance & Interfaces
Exceptions & Recursion
JavaFX & GUI
100

What keyword is used to create a new object in Java?

new

100

What do we call an instantiation of a class in Java?

An object

100

What keyword is used to inherit from a superclass?

extends

100

What do we call an issue where code breaks while running, like dividing by zero?

Runtime error

100

What layout manager stacks elements vertically in a GUI?

VBox

200

What is the entry point method of a Java program?

public static void main(String[] args)

200

What is the term for the blueprint used to create objects?

A class

200

What is the term for the relationship where one class "has a" reference to another class?

Composition

200

What mechanism do we use to catch and handle exceptions in Java?

try/catch

200

What JavaFX node lets a user select an option from a list like a dropdown?

ComboBox

300

What do we call a block of code that performs a specific task and can return a value?

Method or Function

300

What keyword is used to refer to the current object inside a method or constructor?

this

300

What keyword is used when a class adopts an interface’s method requirements?

implements

300

What type of error occurs when you forget a semicolon or misspell a keyword?

Syntax error

300

What is the GUI component that represents a clickable item that triggers an action?

Button

400

What data structure in Java allows dynamic resizing and element access by index?

ArrayList

400

What do we call defining multiple methods with the same name but different parameters?

Overloading

400

What keyword can a subclass use to call the constructor of its parent class?

super

400

What do we call an error that causes the program to produce incorrect output but doesn’t crash?

Logic error

400

What is the purpose of a Label in JavaFX?

To display text or images to the user

500

What Java Class lets us write output to a file?

PrintWriter

500

What OOP principle means combining data and methods together and restricting outside access?

Encapsulation

500

Can a Java class extend more than one class? If not, how can it achieve similar functionality?

No, Java does not support multiple inheritance with classes. A class can implement multiple interfaces to achieve similar functionality.

500

Why is a base case essential in a recursive method?

Without a base case, the method will call itself infinitely, causing a stack overflow error.

500

What layout manager places elements in top, bottom, left, right, and center positions?

BorderPane