what is the exact meaning of static keyword? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

what is the exact meaning of static keyword?

2nd Jul 2016, 1:42 PM
Sagar Chaure
Sagar Chaure - avatar
5 Answers
+ 5
if u want to know why main() method is static the reason is that when a member is declared static it can be accessed before any objects of that class are created.And main() is declared static bcoz it must be called before any objects exist
3rd Jul 2016, 6:56 AM
Sagar Agrawal
Sagar Agrawal - avatar
+ 2
Static variables and methods belong to the class instead of a specific variable! Static methods can be run without create an instance of main!
2nd Jul 2016, 1:55 PM
Arjun
+ 2
as static word mean like unchanged, changeless, constant, consistent or uniform. same in java static define the attribute or method that are consistent to all ref variable(object) of the class.
2nd Jul 2016, 5:49 PM
Nitin Kumar
Nitin Kumar - avatar
+ 2
"static" keyword means whether we have to use an object or not to access the function from main where as main is always declared static static can even be replaced by volatile or can be left blank
2nd Jul 2016, 6:25 PM
Paras Mehrotra
Paras Mehrotra - avatar
0
best answer sagar agarwal.
3rd Jul 2016, 7:27 AM
Sagar Chaure
Sagar Chaure - avatar