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
How many types of flags are there?
What's the difference between comparison done by equals method and == operator?
What are the basic interfaces of java collections framework?
Explain about main() method in java ?
What is the exact difference in between unicast and multicast object? Where we will use?
List two java ide’s?
Is it possible to compare various strings with the help of == operator? What are the risks involved?
What is the original name of java?
What is remote method invocation (rmi)?
How many bytes is 255 characters?
What is the meaning of 3 dots in java?
Explain how to convert any java object into byte array.
What is arrays aslist in java?
What is the use of math abs in java?
Is the empty set a singleton?