Home> Java> JavaBase> body text

What does public static void main mean?

hzc
Release: 2020-06-16 17:25:04
Original
10008 people have browsed it

What does public static void main mean?

What does public static void main mean?

This is the entry address of the java program. When the java virtual machine runs the program, the first thing it looks for is main. Method. The function is the same as the main() function in C language. Only java programs with main() method can be executed by the java virtual machine, which can be understood as the prescribed format

For the inside Parameters and modifiers

public: Indicates the access rights of this program, indicating that it can be referenced on any occasion, so that the Java virtual machine can find the main() method to run the javac program

static: Indicates that the method is static, does not depend on the object of the class, and belongs to the class. When the class is loaded, the main() method is also loaded into the memory.

void:main The () method does not require a return value

main: Convention, specified

String[] args: Receive parameters from the console

Recommended tutorial: "java tutorial

The above is the detailed content of What does public static void main mean?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!