can we overload main method?

Answer Posted / srinivaskumar.nimmana

Yes, we can... like this,

public static void main(String[] args){....}
pulbic void main(int a){....}
public static int main(flaot f){....}
public String main(string s){....}

in the above code public static void main(string[] args) executed as thread remaining methods are normal methods in our java class. in jvm p.s.v.main(string[] args) defined with thread so jvm always search for this syntax only.any other main() with diffrent parameters are consider as normal method

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why you should not use singleton?

536


Why is the type for real numbers called double?

540


Explain the difference between private, public, package and protected in java?

593


What is module in oop?

567


How many tetrahedral voids are there in bcc?

542






What do you mean by a JVM?

560


What is output buffer?

566


Explain the features of interfaces in java?

554


What is callablestatement? How you can call stored procedure to pass in parameter?

542


Can constructor be inherited?

575


os is developed in c no java is more secured then c na why dont the os developed is developed using java

3518


difference between byte stream class and character stream class?

4081


What is the old name of java?

499


How are java objects passed to a method and what are native methods?

590


Why is java called java?

541