
Java Programming Quiz 1

Quiz
•
Computers
•
University
•
Hard
Vijaya Kumar DTT
Used 6+ times
FREE Resource
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
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Java Quiz based on array

Quiz
•
University
16 questions
Think it through

Quiz
•
University - Professi...
15 questions
Trắc nghiệm kiến thức Java Core - Phần I

Quiz
•
University
18 questions
JavaScript Variables, Data Types, and Operators Quiz

Quiz
•
University
18 questions
SAINS KOMPUTER TING 4 - 1.5 AMALAN TERBAIK PENGATURCARAAN

Quiz
•
12th Grade - University
15 questions
Data Types & Variables

Quiz
•
University
15 questions
module3

Quiz
•
University
21 questions
quiz 2nd/3rd year

Quiz
•
University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University