Home  >  Article  >  Java  >  what is java object

what is java object

爱喝马黛茶的安东尼
爱喝马黛茶的安东尼Original
2019-11-14 13:46:024095browse

what is java object

Object is the base class of all classes. You can check the jdk documentation to learn about this. All classes inherit from Object.

1. The Object class is the parent class of all classes and is located in the java.lang package.

2. Arrays are also subclasses of the Object class.

3. Commonly used methods of the Object class are:

·toString();

·equals();

·hashCode();

objects This kind of parameter definition is in the uncertain method A polymorphic representation in the case of parameters. That is, this method can pass multiple parameters, and the number of parameters is uncertain. In this way, you need to do some processing accordingly in the method body. Because Object is the base class, using the parameter form objects allows all objects inherited from Object to be used as parameters. This method should be relatively rarely used in practice.

what is java object

#obj is a parameter form composed of an Object array. Note that the parameters of this method are fixed and are an Object array. As for the elements stored in this array, they can be objects of all classes that inherit from Object.

Many java training videos, all on the PHP Chinese website, welcome to learn online!

The above is the detailed content of what is java object. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn