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

Can we increase size of array?

579


What is difference between adapter class and listener?

505


What is the association?

557


Which programming language is best in future?

529


What is difference between stringbuffer and string?

498






How do you compare two strings lexicographically?

546


How big is a boolean?

583


What are "methods" and "fields"?

580


What is the purpose of interface?

588


what is the difference between Object Based Language and Object Oriented Language?

606


What is the difference between sleep and wait in java?

517


Why pointers are not used in java?

582


What are the 3 types of loops in java?

537


What is parse method?

547


Write a program to find the greatest of three numbers in java?

565