Java 7 Objects class [closed]
There is a public final class Objects
in Java 7 that extendes the java.lang.Object
base class.
Will this by default be the base class like or do we need to call the method on "Objects" class and call the corresponding methods?
No. Nothing changes. The Objects
class is simply an utility class. It has only static methods, it's in the util
package, and does what ObjectUtils
from commons-lang is doing.
Objects is final and it extends Object giving you null safe utilities.
精彩评论