Can u overload main()method.Give with example.

Answer Posted / srinu

yes we can overloaded the main() method

public class A
{
public static void main(int a[])
{
System.out.println("overloaded method");
}

public static void main(String a[])
{
System.out.println("main method");
}


output: overloaded method

Is This Answer Correct ?    26 Yes 89 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

describe method overloading

706


What are the ways in which a thread can enter the waiting state?

703


What is meant by JVM? Is JVM platform independent or not?

825


How can we create a synchronized collection from given collection?

836


Why does java not support operator overloading?

891


Should a main method be compulsorily declared in all java classes?

777


What does the string method compareto () do?

755


What is constructor in java ?

815


When do you get classcastexception?

776


How to sort an unsorted array in java?

855


Considering notepad/ie or any other thing as process, what will happen if you start notepad or ie 3 times? Where 3 processes are started or 3 threads are started?

884


Is java still relevant?

727


What is finalize()?

867


Explain importance of finally block in java?

789


What do you know about the garbate collector?

791