
Java Programming Quiz 1
Authored by Vijaya Kumar DTT
Computers
University
Used 6+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
18 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of a constructor in Java?
To destroy an object
To initialize an object
To define a method
To create a static variable
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which keyword is used to create an instance of a class?
class
new
this
static
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Can a class have multiple constructors?
No, only one constructor is allowed
Yes, with different parameter lists
Yes, but only with the same parameters
Only if the class is static
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Why are Strings immutable in Java?
To improve performance
To ensure security and thread safety
To allow modification of String objects
To reduce memory usage
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code? String s1 = "Hello"; String s2 = "Hello"; System.out.println(s1 == s2);
false
true
Compilation error
Runtime error
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which class is thread-safe for String manipulation?
String
StringBuilder
StringBuffer
None of the above
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the this keyword refer to in Java?
The class itself
The current object
A static method
The parent class
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
15 questions
Data Mining - Classification Mining
Quiz
•
University
18 questions
C++ Procedurale Best of
Quiz
•
University
20 questions
Introduction to Machine Learning
Quiz
•
University - Professi...
20 questions
Web Development and Programming
Quiz
•
University
16 questions
Quiz on List and Tuples
Quiz
•
University
16 questions
JavaScript Learning Quiz 1
Quiz
•
12th Grade - University
13 questions
AI-1
Quiz
•
KG - University
15 questions
C Programming - Unit 1 MCQ
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade