Posted by : Unknown
Friday, 19 June 2015
public class MainMultiple
{
public static void main(String args[])
public static void main(String args[])
{
main(122);
main('f');
main("hello java");
}
main(122);
main('f');
main("hello java");
}
public static void main(int i)
{
System.out.println("Overloaded main()"+i);
}
System.out.println("Overloaded main()"+i);
}
public static void main(char i)
{
System.out.println("Overloaded main()"+i);
}
System.out.println("Overloaded main()"+i);
}
public static void main(String str)
{
System.out.println("Overloaded main()"+str);
}
System.out.println("Overloaded main()"+str);
}
}
Output:
Overloaded main()122
Overloaded main()f
Overloaded main()hello java