+ 1
So static variables are created once in memory and will not be remade if another instance of the same class is created. For instance if you have a counting variable say private static int count = 0; and every time in the constructor of the class you incremented count by 1 so example Dog() { count++ } your count variable will change each time you make a new object of the class but it will not reset like other instance variables such as the dogs name, age ect. So you can think of static only being able to create the variable in memory only once for all instances of the class. I hope I helped and didn't confuse you.
23rd Sep 2016, 3:45 AM
Catlin
Catlin - avatar