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