As we all know,Object is the root class in Java. I found a class named Objects that looks quite similar toObject.
TheisObjects class has confused me for a while. Can anybody tell me when and where we should use the Objects class?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Objectssimply contains a set of utility methods that are useful in combination withObjectinstances. Note that it can’t be instantiated (it’sfinaland it has nopublicconstructor) and only containsstaticmethods.The naming schema of putting utility methods in pluralized-name classes is pretty common in the JDK:
CollectionsArrays(although strictly speaking there is no correspondingArrayclass)Other libraries also use this scheme, for example Guava:
MapsStrings