(3) class_method_constructor * class name * The class name must be consistent with the source file name, and there must be no spaces between English letters. * The first letter of a class name cannot be a number, and the first letter can be _ or $. * The class name cannot be a keyword. * If the class name contains multiple words, the first letter is generally capitalized. * The class name cannot contain special characters except $ and. Method Name: * The first letter cannot be a number, in other places, the number * method cannot contain special characters other than _ and $. * A class cannot contain method names with the same parameters, if a method has different parameters and different numbers of parameters, the method name can be the same as that of other methods. Constructor classification: contains the parameter constructor and the parameter constructor. It can contain one or more parameters. The parameter types are not fixed: every class created without any parameters will contain a default no-argument constructor syntax format: access modifier Class Name (parameter list) {} note: * The constructor name must be consistent with the class name. * The number of constructor parameters ranges from 0 to multiple. * There is no keyword between the access modifier and the class name. * The types of parameters constructed in the constructor can be multiple types, that is, eight basic data types, sets, and object characters. * A class can contain multiple constructor, however, the number or type of parameters passed in each constructor must be different: * create an object example: Student st2 = new Student2 (); the new keyword is followed by the default no-argument constructor that calls the Student2 class to create the st2 object * assigning a value to the attribute is to assign the attribute public class Student3 {String name; string pass; // defines two attributes: NAME and PASS // The public Student3 () {}// public Student3 (String _ name) constructor with Parameters) {name = _ name;} // contains two parameters: public Student3 (String _ name, String _ pass) {name = _ name; pass = _ pass;} public void show () {System. out. println ("name:" + name);} public void show2 () {System. out. println ("name:" + name + "Password:" + pass);} public static void main (String args []) {// create the object Student3 st3 = new Student3 ("", "123"); // call the show method st3.show2 () through the created object ();}} if a class contains one or more constructors with parameters, the constructors with parameters will overwrite the default one without parameters, call the constructor object creation method after the re-creation: Create an object of a class or instantiate the object class name object name = new class constructor; when you call an attribute in a class or a method in a class to access a property, only the class name is required for access to the static property. property name = "value" if you are accessing non-static properties, You need to first create a Class Object and include the package in the source code file of the created object source code structure, A package to be imported and a class file can only exist in one package (error). Only one different package can exist in one package) it is used to store multiple source code files. It is a packaging function of multiple source code files. It is used to classify and rename multiple files to make the code structure clearer. The naming rules of the package are as follows: 1. the package name must be meaningful. 2. the package name ranges from large to small. the package name cannot contain special characters except _ and $. the package name cannot contain the keyword package naming format: industry. region. company. project function example: com. hb. ibm dto