004_Java Instance Variables
Quiz
•
Computers
•
12th Grade
•
Practice Problem
•
Easy
Joe Cusack
Used 1+ times
FREE Resource
Enhance your content in a minute
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the default value of an `int` instance variable in Java?
1
0
-1
null
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is true about instance variables in Java?
They are shared across all objects of a class.
They belong to an instance of a class.
They are always initialized to zero.
They can only be accessed through the class name.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In the given class `Car`, what will be the output of `car1.displayCarInfo()` if `car1` is initialized as `new Car("Toyota", 2022)`?
Car Model: Honda, Year: 2021
Car Model: Toyota, Year: 2022
Car Model: Toyota, Year: 2021
Car Model: Honda, Year: 2022
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How are instance variables accessed in Java?
Through the class name
Through an instance of the class
Directly without any reference
Using the `static` keyword
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the default value of a `String` instance variable in Java?
""
"null"
null
"undefined"
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statements is true about static variables in Java?
They are initialized with default values only if explicitly declared.
They are unique to each instance of a class.
They are shared across all instances of a class.
They cannot be accessed through the class name.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following code snippet: ```java Car car3 = new Car("Ford", 2020); ``` What will be the value of `car3.year` after this statement is executed?
2020
0
null
2021
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
10 questions
2025 python class first quiz
Quiz
•
9th Grade - University
13 questions
GIT COURSE
Quiz
•
University
12 questions
R variable Data Type and Flow Control Quiz
Quiz
•
University
10 questions
Planning and Implementation of Information Security
Quiz
•
University
14 questions
LA5.C5: Branching and Subroutines
Quiz
•
9th Grade - University
15 questions
SENATIC Parcial Guía 3_PseInt
Quiz
•
10th Grade - University
10 questions
T02: Python - The Basics
Quiz
•
University
15 questions
ENGINEERING DATA ANALYSIS PRELIM
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 Computers
26 questions
Christmas Movie Trivia
Lesson
•
8th Grade - Professio...
15 questions
Christmas Song Emoji Pictionary
Quiz
•
7th - 12th Grade
20 questions
Christmas Movies
Quiz
•
1st - 12th Grade
55 questions
CHS Holiday Trivia
Quiz
•
12th Grade
20 questions
Christmas Movie Trivia
Quiz
•
9th - 12th Grade
29 questions
christmas facts
Lesson
•
5th - 12th Grade
20 questions
Christmas Trivia
Quiz
•
5th - 12th Grade
20 questions
Stages of Meiosis
Quiz
•
9th - 12th Grade
