[英]What is the difference between Object and Objects in java
What's the difference between them and how can I use Objects?它们之间有什么区别,我如何使用对象?
Objects | Object
java.util | java.lang
Class Objects | Class Object
java.util.Objects | java.lang.Object
The javadoc can help: javadoc 可以提供帮助:
java.lang.Object对象
Class Object is the root of the class hierarchy.
类对象是类层次结构的根。 Every class has Object as a superclass.
每个类都有一个 Object 作为超类。 All objects, including arrays, implement the methods of this class.
所有对象,包括数组,都实现了这个类的方法。
java.util.Objects java.util.Objects
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.
这些实用程序包括空安全或空值容忍方法,用于计算对象的哈希码、返回对象的字符串以及比较两个对象。
Object
is a implicit base class for all classes in java. Object
是 java 中所有类的隐式基类。 Objects
is a utility class introduced in java 7 that contains several very convenient static utility methods. Objects
是 java 7 中引入的一个实用程序类,它包含几个非常方便的静态实用程序方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.