Java api ------ Object class, javajsonobjectapi
Java API is a Java Application programming Interface. It is a set of implemented standard classes provided by java. The Java API class library is a bit like a dll file in win32. It encapsulates many functions, does not provide specific entities, but only provides information such as method names and parameters. These class libraries can be used to conveniently and quickly implement various functions in the program. These can be divided into different sets based on different functions. Each set is combined into a package called a class library. Most of the class libraries in java are provided by Sun. These libraries are called Basic class libraries.
Common java packages: java. lang Package, java. io package, java. util package, java. swing package and java. awt package, java.net package, java. applet package, java. beans package. The specific applicability of these seven packages is not described.
Object Class
The Object class is the direct or indirect parent class of all classes in the java program, and is at the highest level of the class. If a class does not contain the keyword extends during declaration, the system considers that the class will directly inherit the Object class. The Object class contains the public attributes and methods of all java classes. These attributes and methods can be directly used in any class.
The Object class has a default constructor:
Public Object () {}// the method body is empty. This default constructor is called first when constructing a subclass Object.
Common Object methods:
Public Boolean equals (Object obj): returns true if two class variables point to the same Object.
Public final Class getClass () obtains information about the Class to which the current object belongs, and returns the Class Object
Public String toString () is converted to a String.
Protected Object clone () generates a backup of the current Object and returns a copy.
........
Example of the getClass method:
Class Name {} public class GetClassName {public static void main (String args []) {Name name = new Name (); System. out. println ("the class of the Object name is:" + (name. getClass ()));}}