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
What is a byte string?
What are the restrictions that are applied to the java static methods?
How to invoke external process in java.
Can singleton class be serialized?
What is the generic function?
What is java in simple terms?
Describe string intern() methodology
What is gc()?
What do you understand by classes in java?
How do you sort in descending order in java using collections sort?
How big is a pointer?
What is a singleton class? Give a practical example of its usage.
what is interface in java? Explain
How to perform binary search in java?
How can you generate random numbers in java?