I know the instance variables are one per object. And the Static Variables are one per class.
I have used like below: int i = 10; //Instance variable static int i = 10; // Static Variable.
I comw across like this: static Dog d = new Dog();
Pls explain the above line and its importance. And also I come across this cdoings in Singleton class and whether inheritance is possible in the singleton class. Since we are marking construtor as private. pls explain that too
You're on the right track here. A third instance will get its own copy of a,b and share c again.
If your class will modify c you have a great reason to read up on threads and synchronize.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.