004_Java Instance Variables
Quiz
•
Computers
•
12th Grade
•
Practice Problem
•
Easy
Grit and Motivation
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
Create a free account and access millions of resources
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
POST TEST WEB STATIC
Quiz
•
University - Professi...
10 questions
Microsoft Teams
Quiz
•
KG - 12th Grade
15 questions
BASIC C PROGRAMMING
Quiz
•
University
20 questions
1ºDAM/DAW - Entornos de Desarrollo - UD1-6 - Prof. C. Boni
Quiz
•
University - Professi...
20 questions
Python básico
Quiz
•
9th - 12th Grade
11 questions
Chapter 2 System Planning
Quiz
•
University
10 questions
Les variables sous Python
Quiz
•
10th - 12th Grade
20 questions
CSS Pseudo dan CSS Grid System
Quiz
•
University
Popular Resources on Wayground
10 questions
Forest Self-Management
Lesson
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
30 questions
Thanksgiving Trivia
Quiz
•
9th - 12th Grade
30 questions
Thanksgiving Trivia
Quiz
•
6th Grade
11 questions
Would You Rather - Thanksgiving
Lesson
•
KG - 12th Grade
48 questions
The Eagle Way
Quiz
•
6th Grade
10 questions
Identifying equations
Quiz
•
KG - University
10 questions
Thanksgiving
Lesson
•
5th - 7th Grade
Discover more resources for Computers
30 questions
Thanksgiving Trivia
Quiz
•
9th - 12th Grade
11 questions
Would You Rather - Thanksgiving
Lesson
•
KG - 12th Grade
10 questions
Identifying equations
Quiz
•
KG - University
18 questions
Thanksgiving Trivia
Quiz
•
4th - 12th Grade
20 questions
Thanksgiving
Quiz
•
KG - 12th Grade
28 questions
Ser vs estar
Quiz
•
9th - 12th Grade
10 questions
hands washing
Quiz
•
5th - 12th Grade
53 questions
US History Domain 1 Review CP 2025 (Tech Enhanced)
Quiz
•
9th - 12th Grade
