0
Instance variables vs class variables?
can anyone explain this in very simple no more then 2 lines lol. im thinking that when static is used a instance of class var is now just a class var.?
3 Respostas
+ 2
instance variables are defined at instance level and can have a different value for each instance. static variables are defined at class level and share one value among the instances.
For example, if you have a class Person with instance variable name and static variable numberOfPeople, you can instantiate several people with different names and at the same timekeep track of the overall number of people.
0
straight to the point thanks!
0
@David you're welcome