-1
  1. Explain Java main method? 2.Why main is always public in Java? 3.why main is always static? 4.why main always accepts String array as argument? 5.can we overload main method in java?
  2. can we override main method in java?

Please explain in detail

  • 1
    Welcome to StackOverflow Lovely Singh! Your question is well below the quality that is expected here. I suggest visiting [How to Ask](https://stackoverflow.com/help/how-to-ask) in order to get a better insight on how to ask a solid question. – nijm Oct 14 '18 at 15:25

1 Answers1

0

Hi Please find the answers below: 1.Explain Java main method?

Please find complete explanation in following video : https://www.youtube.com/watch?v=Z7rPNwg-bfk&feature=youtu.be

2.Why main is always public in Java?

So that main can be accessed by JVM. 3.why main is always static? at RunTime JVM do not create any object and static method can be accessed by class name, so main is always static. 4.why main always accepts String array as argument? it is a command line argument and any data type can be converted to string just by putting it in double quotes, so string is used. 5.can we overload main method in java? Yes 6. can we override main method in java? No Static methods can not be overridden.