Yes, main()
can be overloaded. Let’s see the following examples for better clarity :
ExampleMain.java
class
ExampleMain
{
public
static void main(String[] args)
{
System.out.println("Hiii");
}
public
static void main(int x)
{
System.out.println("Hello");
}
}
Output
Hiii
No comments:
Post a Comment