The zero-based JAVA-2. The composition of the Java program

Source: Internet
Author: User
1.publicclass  YD2. { 3. Public  staticvoid  Main (string args[])4.   {5.     System.out.println ("I am a new learner in Java!") "); 6.  } 9.3

The first line of public means that this is a common class (can be omitted) class is declaring a class, and the yd behind him is the class name (the class name can be arbitrarily written)

The second line, "{", and Line Seventh "}", must appear to be the defining symbol of the class body, in which everything between these brackets belongs to the class yd. (There is no problem in this pair of parentheses.)

The third line, main, is the Java-defined name and cannot be changed. The Java interpreter takes main as the entry to execute the program's () after main () is the parameter list bracket of the method and cannot be omitted. String args[] In parentheses is the argument passed to the main () method, and string is the system-predefined class of strings. Args[] is an array of args that the user obtains can change. Public in front of main represents access rights, which means that all classes can use this method. Staitc

The zero-based JAVA-2. The composition of the Java program

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.