Can I have multiple Main () methods in the same class?
I'll answer
Earn 20 gold coins for an accepted answer.20
Earn 20 gold coins for an accepted answer.
40more
40more
Studied at the University of Johannesburg, Lives in Johannesburg, South Africa.
'main' means public static void main(String[] args) which is entry point in java programs . You can have more classes that contain the main() in a program . And you can choose to execute one class or another class. But you can't have more than one main method (String[] args as arguments) within same class.
2023-06-18 06:42:31
评论(499)
Helpful(122)
Helpful
Helpful(2)

Ethan Davis
QuesHub.com delivers expert answers and knowledge to you.
'main' means public static void main(String[] args) which is entry point in java programs . You can have more classes that contain the main() in a program . And you can choose to execute one class or another class. But you can't have more than one main method (String[] args as arguments) within same class.