Java中Object和Objects的基本区分

xiaoxiao2021-02-28  106

Class Object

java.lang.Object public class Object Since: JDK1.0

Class Object is the root of the class hierarchy. Every class has Object as a superclass. All objects, including arrays, implement the methods of this class.

Class Objects

java.lang.Object java.util.Objects public final class Objects extends Object Since: JDK1.7

This class consists of static utility methods for operating on objects. These utilities include null-safe or null-tolerant methods for computing the hash code of an object, returning a string for an object, and comparing two objects.

转载请注明原文地址: https://www.6miu.com/read-23365.html

最新回复(0)