0

[DUPLICATE] What is the use of putting (string [] args) after "main"?

Would my code still work if I don't put it up

13th Jan 2017, 11:52 PM
Nazarudin
Nazarudin - avatar
1 Answer
0
You can use it to pass the program arguments when you start it. (So probably nothing you'd need anytime soon, I've never used this once so far). Also you can't just leave it away, you need a function 'public static void main(String[] args){}', otherwise the program won't know where to start. One last thing: Java is case-sensitive, so don't forget that String (and System.out) start with a capital letter!
14th Jan 2017, 12:04 AM
Robobrine
Robobrine - avatar