Java – ` public static void main (string [] args) ` what does it stand for?

What is public static? What does < x > void main (string [] args) stand for? I tried to understand, but I didn't get it I know public static void main (string [] ARG)

Solution

Let's look at each one in turn:

>Public – it's a public method that can access anything that declares its class > < x > – it's a (strange) general method with unbound type variable x > static – the method is related to the type that declares it, Instead of any specific instance of the type > void – the method does not return a value > main – method name > string [] args – a parameter of type string [] named args

Main is the entry point used by the JVM When you run:

java foo.bar.Baz

It will try in class foo bar. A main method was found in Baz There is no denying that I have never seen a general main method before For more information about generics in Java, read the Java generics FAQ

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>