Advertisements
Advertisements
Question
Class variables ae also known as ______ variables.
Options
publlic
instance
static
default
MCQ
Fill in the Blanks
Advertisements
Solution
Class variables ae also known as static variables.
Explanation:
In Java, class variables are declared using the static keyword. Unlike regular instance variables, a static variable has only one single copy shared across the entire class, meaning all objects created from that class access and change the exact same memory location
shaalaa.com
Is there an error in this question or solution?
Chapter 6: Encapsulation - Exercises [Page 148]
