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
JTW Decoder
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
EN
DE
RU
FR
ES
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
Which of these is not a valid Java access modifier?
public
protected
private
friend
Next >
2/25
Which Java feature allows the method of a subclass to override the method of its superclass?
Inheritance
Encapsulation
Polymorphism
Abstraction
Next >
3/25
What is the purpose of the 'this' keyword in Java?
To refer to the current class instance variable
To create a new instance of a class
To terminate the current method
To invoke a method of the superclass
Next >
4/25
In Java, which of the following is a valid way to declare an array?
int array[5];
int[] array = new int[5];
array = new int[5];
int array[] = new int[5];
Next >
5/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 >
6/25
Which of these is an immutable class in Java?
java.lang.StringBuilder
java.lang.String
java.lang.StringBuffer
java.util.ArrayList
Next >
7/25
In Java, what is the difference between '==' and 'equals()'?
'==' checks for value equality, 'equals()' checks for reference equality
'==' checks for reference equality, 'equals()' checks for value equality
There is no difference
'equals()' is used only for strings
Next >
8/25
What is the purpose of the 'package' statement in Java?
To enhance the performance of the application
To create a new thread
To define a namespace for classes
To import external libraries
Next >
9/25
What is 'autoboxing' in Java?
Automatically converting a primitive type into its corresponding wrapper class
The process of optimizing code automatically
Creating an automatic backup of the code
A feature for automatic memory management
Next >
10/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 >
11/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 >
12/25
Which of the following is a checked exception in Java?
NullPointerException
ArrayIndexOutOfBoundsException
IOException
RuntimeException
Next >
13/25
Which Java feature allows runtime binding of method calls?
Static Typing
Dynamic Binding
Method Overloading
Method Overriding
Next >
14/25
In Java, what is a 'Lambda Expression'?
A concise representation of an anonymous function that can be passed around
A special type of exception
A way to create a new thread
An expression used for array manipulation
Next >
15/25
Which method is used to compare two strings for equality in Java?
compareTo()
equals()
equalsIgnoreCase()
compare()
Next >
16/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 >
17/25
What is the primary difference between 'StringBuffer' and 'StringBuilder' in Java?
StringBuffer is mutable, while StringBuilder is immutable
StringBuilder is faster as it is not synchronized
StringBuffer can store characters, while StringBuilder cannot
StringBuilder is thread-safe, while StringBuffer is not
Next >
18/25
Which of these is not a feature of Java?
Multiple inheritance of classes
Automatic garbage collection
Platform independence
Strong memory management
Next >
19/25
What does the 'final' keyword indicate when applied to a method in Java?
The method can be overridden in a subclass
The method cannot be overridden in a subclass
The method will return a final value
The method will be executed at the end of the program
Next >
20/25
In Java, what is the default layout manager for the JFrame container?
FlowLayout
GridLayout
BorderLayout
CardLayout
Next >
21/25
What is the use of the 'implements' keyword in Java?
To inherit from an abstract class
To include an interface in a class
To mark a method as mandatory to override
To declare a class as abstract
Next >
22/25
How is a 'static inner class' different from a 'non-static inner class' in Java?
Static inner class can access static members of the outer class only
Non-static inner class cannot access any members of the outer class
Static inner class requires an instance of the outer class to exist
Non-static inner class can exist independently of the outer class
Next >
23/25
What does the 'this' keyword refer to in Java?
The current method
The current instance of the class in which it is used
A static context in the class
The superclass of the current class
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.