Professional Documents
Culture Documents
Can We Overload Main Method?: Class Public Static Void Int
Can We Overload Main Method?: Class Public Static Void Int
Yes, by method overloading. You can have any number of main methods in a class by method
overloading. Let's see the simple example:
1.
class Overloading1{
2.
3.
System.out.println(a);
4.
5.
6.
7.
8.
main(10);
9.
10.
}
Test it Now