503 33 Powerpoint-Slides Chapter-4
503 33 Powerpoint-Slides Chapter-4
s1.display();
s2.display();
}
}
© Oxford University Press 2013. All rights reserved.
Instance Variables vs. Class Variables
• All instances of the class share the static
variables of the class.
• A class variable can be accessed directly with
the class name, without the need to create an
instance.
• Without the static keyword, it's called
“instance variable”, and each instance of the
class has its own copy of the variable.