-
Java.long Bag
The classes and interfaces commonly used in Java development are placed under the Java.lang package, so to simplify the use of classes under this package, classes under the Java.lang package do not need to be imported when they are used.
-
The parent class for all classes of the Java.lang.Object class. All classes (including arrays) inherit directly or indirectly from the object class, and also inherit the methods in the class. That is, any class can call a method in the Java.lang.Object class directly . 650) this.width=650; "src=" Http://img.baidu.com/hi/face/i_f13.gif "alt=" I_f13.gif "/>
-
The object class has only one argument-less constructor.
Object ();
-
Methods commonly used in object (see the Java API for specific use):
1.equals () compares two objects for the same.
The return value is a boolean type.
The specific notation is boolean x=a.equals (b);
Note: equals can only compare objects, not the base data type (values of variables/constants, etc.).
2. hashcode () returns the hash code of an object (the hash code is a number that is automatically given to the object when the object is run, unique, tested, and only related to the order in which the object is run in the program, with no relation to the object itself.) )
The return value is of type int
3.toString () converts an object to a string
The return value is of type String.
The converted string is related to the hash code of the object.
The 5.String class represents a string that provides methods for string processing that are commonly used in development, such as: the length of the string, the interception of strings, the substitution of strings, and so on.
A string object is a constant, and its value cannot be modified after it is created.
Common construction methods for String classes
String () non- parametric construction method
String (String str) has a method for constructing a string argument
String (char[]ch) has a method for constructing an array parameter of type Char
String (byte[] b) has a method for constructing a byte array parameter
String declaration and how to create a string object:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/73/1E/wKiom1X1ieeSMgOAAAIyqEPHAGY962.jpg "title=" Stringcj.jpg "alt=" Wkiom1x1ieesmgoaaaiyqephagy962.jpg "/>
The eighth chapter: Java Common Class (i)