Welcome to your Java Developer
Java
Which company originally developed Java?
Microsoft
IBM
Sun Microsystems
Oracle
None
Java
Which of these is not a Java keyword?
Boolean
void
static
public
None
Java
What is the file extension of compiled Java classes?
.java
.class
.jar
.exe
None
Java
Which package is imported by default in every Java program?
java.io
java.lang
java.net
java.util
None
Java
Which keyword is used to inherit a class?
inherits
implements
extends
override
None
Java
Which keyword is used to create an object in Java?
create
object
new
make
None
Java
What is the parent class of all classes in Java?
Class
Runtime
Object
System
None
Java
Which of these allows multiple methods with the same name but different parameters?
Overriding
Inheritance
Encapsulation
Overloading
None
Java
Which collection class allows key-value pairs and does not allow duplicate keys?
Set
Queue
List
Map
None
Java
Which interface is implemented by all collection classes in Java?
Collection
Iterable
List
Set
None
Java
Which of the following is a marker interface?
Runnable
Comparable
Serializable
Cloneable
None
Java
What is the main advantage of using streams in Java 8?
Easier syntax
Works only on arrays
Supports functional programming and parallel operations
Replaces threads
None
Java
Which feature of Java 8 allows methods in interfaces to have a body?
Anonymous classes
Static methods
Lambda expressions
Default methods
None
Java
Which keyword is used to handle exceptions in Java?
try-catch
exception
error
handle
None
Java
Which garbage collection algorithm is used in the JVM by default (Java 11+)
CMS
G1 GC (Garbage First)
Parallel GC
Serial GC
None
Java
What is the difference between == and .equals()?
== compares references, .equals() compares values
No difference
Both compare object content
== compares values, .equals() compares references
None
Java
Which Java keyword is used to define an enumeration?
Enum
enum
enumeration
define
None
Java
What is the purpose of the volatile keyword in Java?
Ensures visibility of changes across threads
Makes variable thread-local
Used for immutability
Makes a variable constant
None
Java
Which design pattern is used to ensure only one instance of a class exists?
Observer Pattern
Factory Pattern
Builder Pattern
Singleton Pattern
None
Java
What does the transient keyword do?
Excludes a field from serialization
Converts object to string
Makes variable synchronized
Marks a variable as temporary
None
Java
What is the purpose of the static keyword?
Create dynamic objects
Allocate memory only once for a class member
Automatically call garbage collector
Make method thread-safe
None
Java
Which collection maintains insertion order?
LinkedHashSet
HashSet
TreeSet
PriorityQueue
None
Java
Which exception is thrown when an array is accessed out of its bounds?
NullPointerException
ArrayIndexOutOfBoundsException
IndexException
ArrayOverflowException
None
Java
Which keyword prevents a method from being overridden?
final
abstract
static
private
None
Java
What does the transient keyword do?
Converts object to string
Marks a variable as temporary
Makes variable synchronized
Excludes a field from serialization
None
Common Jobs
Jobs
Referrals
My Profile