What is the significance of declaring a variable static in c

What is the significance of declaring a variable static in class in java?

Solution

Answer:

when we create variable with static keyword then we can call that variable like static variable or class variable. It means that all instance of the same class can share the same copy of that variable. it means that if one instance changes the value of that static variable that changes will reflect to the another instance of the same class. we can access this static variables by using below syntax.

Classname.variableName

What is the significance of declaring a variable static in class in java?SolutionAnswer: when we create variable with static keyword then we can call that varia

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site