why 'static' required for all methods ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

why 'static' required for all methods ?

27th Aug 2016, 1:44 PM
Prasanna L
Prasanna L - avatar
5 Answers
+ 2
not for all methode if u call a method inside static methode than declared methode as a static and if u dont want to decalared methid but still u want to call non statc methode inside static than create the obj of that class on that object call non static methode. hope u got some what...
27th Aug 2016, 4:33 PM
Vipin Barman
Vipin Barman - avatar
0
yes
27th Aug 2016, 2:32 PM
Vijaya Bharathy V R
Vijaya Bharathy V R - avatar
0
its not required for all methods. Only main method requires static to be mentioned. Based on requirement of calling other methods from main, it may be required
27th Aug 2016, 6:08 PM
Mahender
Mahender - avatar
0
static is used for some methods when you exacatly want single copy/instance
30th Aug 2016, 5:54 PM
SHRIDHAR M PATIL
0
Static = running the method can't modify the method, if I remember correctly
19th Sep 2016, 8:07 AM
Garry Reyom
Garry Reyom - avatar