Cant we change the main in main method | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Cant we change the main in main method

can we write public static void text(strings []args)

26th Nov 2018, 12:54 PM
ROHIT RHT
2 Answers
+ 1
No, main is the entry point. Without it, the program won't know where to start! As the Java language specification says, "The Java Virtual Machine starts execution by invoking the method main of some specified class, passing it a single argument, which is an array of strings." https://docs.oracle.com/javase/specs/jls/se7/html/jls-12.html#jls-12.1
26th Nov 2018, 1:50 PM
Kishalaya Saha
Kishalaya Saha - avatar
0
read this short article/guide, which will show you all the posibilties and rulings https://www.google.nl/amp/s/www.journaldev.com/12552/public-static-void-main-string-args-java-main-method/amp
27th Nov 2018, 12:59 AM
ForFun Fun
ForFun Fun - avatar