+ 1

Why we use static keyword in main class of the java program

public - >static<- void main (String arg [])

28th Mar 2021, 8:48 PM
Haider Ali Waris
Haider Ali Waris - avatar
3 Respuestas
+ 4
static means the method is related to class not object so whenever you run the java program it will call the main method without creating an object of your class
28th Mar 2021, 10:10 PM
Fares Laloui
Fares Laloui - avatar
+ 3
Haider Ali Waris As main method is entry point of every program so it should be call without an object. So if you use static keyword then no need to create an object.
29th Mar 2021, 4:12 AM
A͢J
A͢J - avatar
28th Mar 2021, 9:54 PM
Jayakrishna 🇮🇳