Books
Learn HTML
Learn CSS
Learn Git
Learn Javascript
Learn PHP
Learn python
Learn Java
Exercises
HTML
JavaScript
Git
CSS
PHP
Courses
Quizzes
Snippets
Tools
General Tools
Password Generator
HTML Editor
HTML Encoder
Base 64
Code Diff
JSON Beautifier
CSS Beautifier
Markdown Convertor
Find the Closest Tailwind CSS Color
Phrase encrypt / decrypt
Browser Feature Detection
Number convertor
CSS Maker
CSS Maker
CSS Maker text shadow
CSS Maker Text Rotation
CSS Maker Out Line
CSS Maker RGB Shadow
CSS Maker Transform
CSS Maker Font Face
Color Tools
Color Picker
Colors CMYK
Colors HWB
Colors HSL
Color Hex
Color mixer
Color Converter
Colors RGB
Color Contrast Analyzer
Color Gradient
String Tools
String Length Calculator
MD5 Hash Generator
Sha256 Hash Generator
String Reverse
URL Encoder
URL Decoder
Base 64 Encoder
Base 64 Decoder
Extra Spaces Remover
String to Lowercase
String to Uppercase
Word Count Calculator
Empty Lines Remover
HTML Tags Remover
Binary to Hex
Hex to Binary
Rot13 Transform on a String
String to Binary
Duplicate Lines Remover
Change theme
Dark
Light
System
Books
Learn HTML
Learn CSS
Learn Git
Learn Javascript
Learn PHP
Learn python
Learn Java
How To
How To NodeJs
How To Linux
How To AngularJs
How To PHP
How To HTML
How To CSS
How To Symfony
How To Git
How To Apache
How To JavaScript
How To Java
How To Vue.js
How To Python
Java Basics
1/25
In Java, which of the following is a correct way to create a thread?
Implementing the Runnable interface
Extending the Thread class
Extending the Runnable interface
Implementing the Thread class
Next >
2/25
Which collection class in Java is synchronized?
ArrayList
LinkedList
Vector
HashSet
Next >
3/25
Which interface in Java is used for sorting and ordering?
List
Set
Comparable
Comparator
Next >
4/25
What does the 'static' keyword in Java signify?
The method can be called without creating an instance of the class
The method is immutable
The method is synchronized
The method returns a static value
Next >
5/25
Which exception is thrown when trying to access an element with a key that does not exist in a HashMap?
NullPointerException
ArrayIndexOutOfBoundsException
KeyNotFoundException
NoSuchElementException
Next >
6/25
In Java, what does the 'volatile' keyword do to a variable?
It ensures the variable is synchronized across threads
It makes the variable immutable
It increases the variable's access speed
It makes the variable transient
Next >
7/25
Which of these is an immutable class in Java?
java.lang.StringBuilder
java.lang.String
java.lang.StringBuffer
java.util.ArrayList
Next >
8/25
How do you declare a constant variable in Java?
Using the 'constant' keyword
Using the 'static final' keywords
Using the 'immutable' keyword
Declaring without initialization
Next >
9/25
What is the role of the 'break' statement in a loop in Java?
To skip the current iteration of the loop
To pause the loop execution temporarily
To terminate the loop immediately
To continue loop execution indefinitely
Next >
10/25
Which of the following is a checked exception in Java?
NullPointerException
ArrayIndexOutOfBoundsException
IOException
RuntimeException
Next >
11/25
What is the purpose of the 'instanceof' operator in Java?
To compare the performance of two objects
To determine if a specific object is an instance of a class, superclass, or interface
To instantiate a new object of a class
To check the equality of two objects
Next >
12/25
What does the 'synchronized' keyword ensure in a multi-threaded environment?
Faster execution of threads
That only a single thread can access the method or block at a time
That multiple threads can execute the method concurrently
That the method will always be executed by the main thread
Next >
13/25
In Java, which method you must override to use an object as a key in a HashMap?
hashKey()
mapKey()
equals() and hashCode()
getKey()
Next >
14/25
In Java, what is the effect of assigning a 'null' value to a reference variable?
The reference variable is deleted
It causes a compile-time error
The reference variable points to no object
It automatically initializes the object
Next >
15/25
What is 'garbage collection' in Java?
A process of deallocating memory by manually deleting objects
A process of automatically freeing memory occupied by objects that are no longer in use
A tool for optimizing Java code
A method for storing unused objects
Next >
16/25
What is the difference between 'static' and 'non-static' methods in Java?
Static methods can be called without creating an instance of the class
Non-static methods are always synchronized
Static methods are faster
Non-static methods can access any class variable
Next >
17/25
In Java, what is the default layout manager for the JFrame container?
FlowLayout
GridLayout
BorderLayout
CardLayout
Next >
18/25
How can you achieve thread safety in Java?
By using synchronized blocks or methods
By avoiding the use of multiple threads
By using the 'volatile' keyword
By making all methods and variables private
Next >
19/25
What is 'JDBC' in Java?
Java Database Connectivity, a standard API for database access
Java Data Binding Code, a framework for binding data to UI elements
Just-in-time Database Compiler, a tool for database optimization
Java Deployment and Compilation, a deployment tool
Next >
20/25
What is 'encapsulation' in Java?
The technique of wrapping code and data together into a single unit
A process of linking a method with an object
A method of improving code execution time
The division of a program into smaller parts
Next >
21/25
What is 'polymorphism' in the context of Java?
The ability of a variable to hold objects of different types
The ability of Java to run on different platforms without modification
The ability of a method to perform different tasks based on the object
Changing the behavior of an object at runtime
Next >
22/25
In Java, what is the purpose of the 'enum' keyword?
To define a new exception type
To declare a collection of constants
To create an enumeration of values for iteration
To optimize memory usage in large applications
Next >
23/25
In Java, which method would you use to compare two String objects for content equality?
compareTo()
equals()
match()
equalContent()
Next >
24/25
In Java, what is the default value of a boolean variable in a class?
true
false
null
0
Next >
25/25
What is 'type casting' in Java?
Changing a variable from one type to another
A method of error handling
A process of making a class adhere to a specific interface
Assigning a new value to a variable
Next >
To get the result of the quiz, please provide your email address (optional)..
Get Certificate
It seems you haven't answered any questions yet. Please provide your answers to proceed.