
Java Class and Object Quiz
Authored by CSE DOSE
Other
University
Used 3+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
Which of the following best describes a class in Java?
A runtime entity
A blueprint for objects
An instance of an object
A collection of libraries
Answer explanation
Answer: B – a blueprint for objects
Explanation: A class acts as a template that defines variables and methods used to create objects.
2.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
What is an object in Java?
A compiled file
A set of instructions
An instance of a class
A variable
Answer explanation
Answer: C – an instance of a class
Explanation: Objects are specific instances created using a class, representing real-world entities.
3.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
What keyword is used to create an object in Java?
this
new
object
create
Answer explanation
Answer: B – new
Explanation: The new keyword allocates memory and creates a new object of a class.
4.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
Which of the following is NOT a benefit of using classes and objects?
Encourages code reuse
Promotes modularity
Forces linear programming
Simplifies maintenance
Answer explanation
Answer: C – Forces linear programming
Explanation: OOP supports modular and scalable programming, not linear procedural code.
5.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
Which of the following is a correct example of a class structure in Java?
class A { void A(); }
public static class A() {}
class A { int x; void show() {} }
object A {}
Answer explanation
Answer: C – class A { int x; void show() {} }
Explanation: This defines a class with a variable and method — the correct structure in Java.
6.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
What happens to instance variables when multiple objects are created from the same class?
Shared among all objects
Exist only in main()
Each object gets its own copy
Stored in static memory
Answer explanation
Answer: C – Each object gets its own copy
Explanation: Instance variables are unique for every object created from the class.
7.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
Given the class Student, how do you create an object of it?
Student();
Student obj = new Student();
object Student = new();
new Student();
Answer explanation
Answer: B – Student obj = new Student();
Explanation: This is the correct syntax using the new keyword to instantiate an object.
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
20 questions
Pendidikan Bahasa Indonesia
Quiz
•
University
12 questions
Alberta Natural Resources #2
Quiz
•
KG - University
13 questions
Accounting 100
Quiz
•
University
16 questions
TEXTOS FUNCIONALES
Quiz
•
University
15 questions
Léxico general
Quiz
•
University
10 questions
Competencias Ciudadanas
Quiz
•
University
10 questions
17 course French classical menu 01
Quiz
•
University
10 questions
Pasa clases ANECAFYDE Zona Levante
Quiz
•
University
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
Discover more resources for Other
26 questions
Christmas Movie Trivia
Lesson
•
8th Grade - Professio...
20 questions
christmas songs
Quiz
•
KG - University
20 questions
Holiday Trivia
Quiz
•
9th Grade - University
15 questions
Holiday Movies
Quiz
•
University
14 questions
Christmas Trivia
Quiz
•
3rd Grade - University
20 questions
Christmas Trivia
Quiz
•
University
8 questions
5th, Unit 4, Lesson 8
Lesson
•
KG - Professional Dev...
20 questions
Disney Trivia
Quiz
•
University