Define Java Virtual Machine (JVM).
An abstract computing machine that enables Java bytecode execution.
What is Garbage Collection in Java?
Automatic memory management that reclaims memory used by objects no longer needed.
True or false: JIT compilation improves performance by compiling bytecode to native code.
TRUE
JIT stands for Just-In-Time compilation, optimizing runtime performance.
Fill in the blank: Java’s main method signature is _______.
public static void main(String[] args)
What does JNI stand for?
Java Native Interface, allowing Java code to call native applications.
Define multithreading in Java.
The concurrent execution of two or more threads for improved performance.
What is the purpose of synchronized keyword?
To control access to a block of code or object by multiple threads.
True or false: Java supports operator overloading.
FALSE
Java does not allow operator overloading to maintain simplicity.
What is a Java package?
A namespace that organizes a set of related classes and interfaces.
Fill in the blank: Exception handling in Java uses _______ and _______.
try, catch
Define Java Stream API.
A feature for processing sequences of elements using functional-style operations.
What is Lambda expression?
A concise way to represent an anonymous function in Java.
True or false: Java is platform-dependent.
FALSE
Java is platform-independent due to the JVM.
What is a Java Interface?
A reference type that can contain only constants, method signatures, and nested types.
Fill in the blank: Polymorphism allows methods to do _______ based on the object.
different things
Define Java Collections Framework.
A unified architecture for representing and manipulating collections of objects.
What is a HashMap?
A collection that maps keys to values, allowing null values and one null key.
True or false: ArrayList is synchronized.
FALSE
ArrayList is not synchronized; use Collections.synchronizedList for thread safety.
What is Java Reflection?
A feature that allows inspection and manipulation of classes, methods, and fields at runtime.
Fill in the blank: Java Annotations provide _______ about a program but are not part of the program itself.
metadata
Define Java Enums.
A special Java type used to define collections of constants.
What is a ThreadPool?
A group of pre-initialized threads that can be reused for executing tasks.
True or false: Java supports multiple inheritance through classes.
FALSE
Java does not support multiple inheritance to avoid ambiguity.
What is Serialization in Java?
The process of converting an object into a byte stream for storage or transmission.