1/21
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
What is Object-Oriented Programming (OOP)?
Object-Oriented Programming (OOP) is a programming paradigm that structures code around objects that encapsulate state (data fields) and behavior (methods).
What are the four pillars of OOP?
Encapsulation, Abstraction, Inheritance, Polymorphism.
Fill in the blank: A class is a _______ for creating objects.
blueprint
Fill in the blank: An object is an _______ of a class.
instance
What is a constructor in Java?
A constructor is a special method that initializes an object when it is created.
What is encapsulation?
Encapsulation restricts direct access to object data and provides controlled access through getter and setter methods.
What is inheritance?
Inheritance allows a class (child class) to acquire properties of another class (parent class).
What is polymorphism?
Polymorphism allows methods to be used in different ways, specifically through method overloading and overriding.
What is an abstract class?
An abstract class cannot be instantiated and may contain abstract methods.
What is an interface?
An interface defines a contract for classes to follow.
What is an exception?
An exception is an unexpected event that disrupts program execution.
What are checked exceptions?
Checked exceptions are exceptions that must be handled, such as IOException.
What are unchecked exceptions?
Unchecked exceptions are runtime errors, such as NullPointerException.
How do you read a file in Java?
Using Scanner to read the file contents.
What is a 1D array in Java?
A 1D array stores a linear sequence of elements.
How do you declare and initialize a 1D array?
Declare with int[] arr = new int[5]; and initialize with int[] arr = {1, 2, 3, 4, 5};.
How do you declare a 2D array in Java?
Declare with int[][] matrix = new int[3][3]; for a 3x3 matrix.
What is a ragged array?
A ragged array is a 2D array where rows have different column sizes.
What are the different types of loops in Java?
For loop, While loop, Do-while loop.
What is garbage collection in Java?
Java automatically reclaims unused objects.
What is multithreading?
Multithreading allows concurrent execution of tasks.
What is the Singleton design pattern?
The Singleton design pattern ensures only one instance of a class.