Can u overload main()method.Give with example.
Answer Posted / tushar
class Checkmain
{
public static void main(String args[])
{
System.out.println("helloCheckmain string main ");
}
}
class Checkmain1 extends Checkmain
{
public static void main(String args[])
{
System.out.println("helloCheckmain1 string main ");
}
}
public class Main
{
public static void main(String args[])
{
String S[]=new String[10] ;
System.out.println("******string main**********");
int q=10;
main(q);
Checkmain.main(S);
Checkmain1.main(S);
}
public static void main(int a
{
String S[]=new String[10] ;
System.out.println("000000000 int main 0000000000");
Checkmain.main(S);
Checkmain1.main(S);
}
}
| Is This Answer Correct ? | 8 Yes | 1 No |
Post New Answer View All Answers
Can we convert integer to string in java?
Are generics important java?
Can a class extend more than one class?
How would you dynamically allocate memory to an array?
What is the difference between static binding and dynamic binding?
What are unchecked exceptions in java?
How do you convert string to int in java?
When arithmeticexception is thrown?
What is a static class in java?
Is list ordered in java?
What are jee technologies?
What is the main functionality of the remote reference layer?
what is mutual exclusion? How can you take care of mutual exclusion using java threads? : Java thread
What is java util?
What is the difference between menuitem and checkboxmenu item?