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

Can we catch more than one exception in a single catch block?

627


What is a bubble sort in java?

547


How do you make an arraylist empty in java?

478


What does replaceall do in java?

488


What is the exception hierarchy in java?

485






What are peerless components?

620


How many types of classes are there in java?

523


List some oops concepts in java?

582


What do you mean by formatting?

547


What is a string what operation can be performed out with the help of a string?

509


How to display names of all components in a Container?

2488


What is indexof?

545


Why inputstreamreader is used in java?

550


What is unicode used for?

572


What is the abstract class?

597