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
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 method is called when an object is cloned in Java?
cloneMethod()
copy()
clone()
Object.clone()
Next >
3/25
Which Java feature allows the method of a subclass to override the method of its superclass?
Inheritance
Encapsulation
Polymorphism
Abstraction
Next >
4/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 >
5/25
Which of the following is true about a 'final' class in Java?
It can be extended by other classes
It cannot be instantiated
It can have final methods only
It cannot be extended by other classes
Next >
6/25
Which of these data types is used to represent a single character in Java?
String
char
Character
byte
Next >
7/25
How do you handle exceptions in Java?
Using try-catch blocks
By using the 'throws' keyword
By using the 'extends' keyword
By declaring them as static
Next >
8/25
What is the function of the 'extends' keyword in Java?
To inherit methods from an interface
To extend a method's functionality
To inherit properties and methods from a superclass
To extend the memory allocation for an object
Next >
9/25
What is the role of the 'import' statement in Java?
To include a package in the current file
To export a class to another file
To load a library at runtime
To declare a variable
Next >
10/25
How is a 'JFrame' used in Java?
To create a console-based application
To create a GUI window
To manage database connections
To store data in a file
Next >
11/25
What is an interface in Java?
A class that is used to group related methods with empty bodies
A tool used to debug Java applications
A type of data structure
A template for creating objects
Next >
12/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 >
13/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 >
14/25
Which method is used to compare two strings for equality in Java?
compareTo()
equals()
equalsIgnoreCase()
compare()
Next >
15/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 >
16/25
In Java, what is the default layout manager for the JFrame container?
FlowLayout
GridLayout
BorderLayout
CardLayout
Next >
17/25
What is the main difference between a Java class and a Java interface?
A class defines object properties, an interface defines object behavior
A class can be instantiated, but an interface cannot
Interfaces support multiple inheritance, classes do not
A class is used for implementation, an interface is used for abstraction
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
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 >
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
What is the advantage of using a 'PreparedStatement' in JDBC?
Faster execution for repeated queries
Allows execution of dynamic queries only
Automatically closes database connections
Improves the UI of the application
Next >
25/25
What does the 'static' keyword signify when applied to a block of code in Java?
The code block is related to the static members of the class
The code block cannot be modified
The code block is executed when the JVM loads the class
The code block is executed immediately after the class is instantiated
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.