+ 1

Can we call main method in java?

28th Jan 2017, 7:06 AM
Yuva
Yuva - avatar
2 odpowiedzi
+ 1
Yes, you could call the main() function inside of main() function but you need to use the concept of VAR ARG (Variable Argument). Just use ••• instead of String args[] in main function. Triple Dots indicate variable argument.
28th Jan 2017, 8:32 AM
Arpan Lunawat
Arpan Lunawat - avatar
0
From inside main() or some other function? You could but why? If you have some recursive code you could put it in a seperate method and call that.
28th Jan 2017, 7:19 AM
Blightedsage
Blightedsage - avatar