Instance Variables & Scope QuizS2C Home « Instance Variables & Scope Quiz

Java Objects & Classes Quiz 8

The quiz below tests your knowledge of the material learnt in Objects & Classes - Lesson 8 - Instance Variables & Scope.

Question 1 : What are variables created within a class and outside any method known as?
- Variables created within a class and outside any methods are known as instance variables.
Question 2 : Instance variables live on the stack?
- Instance variables live on the heap.
Question 3 : Instance variables are unique to their class
- Instance variables are unique to an instance of the class not the class itself.
Question 4 : What is the lifetime of an instance variable?
- An instance variable exists as long as the instance of the class it belongs to.
Question 5 : Instance variables can be static
- Instance variables CANNOT be static as they are tied to an instance of the class, not the class itself..
Question 6 : What do instance variables describe?
- Instance variables describe an objects state.
Question 7 : Instance variables are declared within a method?
- Instance variables are declared within a class and outside any methods
Quiz Progress Bar Please select an answer


What's Next?

The next quiz on Java Objects & Classes is all about constructors.