java.lang.Object VS java.util.Objects,what's the difference?

Objects simply contains a set of utility methods that are useful in combination with Object instances. Note that it can't be instantiated (it's final and it has no public constructor) and only contains static methods.

The naming schema of putting utility methods in pluralized-name classes is pretty common in the JDK:

  • Collections
  • Arrays (although strictly speaking there is no corresponding Array class)
  • ...

Other libraries also use this scheme, for example Guava:

  • Maps
  • Strings
  • ...

Tags:

Java

Java 7