There is a created "Class" object with reference to it: "Class crntClass". Expressions:

crntClass==Object.class; 

and

 crntClass==Class.forName("Object"); 

equivalents or interpreter pro100 does not dislike me?
Thank you in advance!

  • one
    I have Class.forName ("Object"); generally java.lang.ClassNotFoundException: Object throws. - avp
  • Right, ATP. Forgot to register the name of the package in front of him. It will be correct like this: "java.lang.Object" - uzumaxy

1 answer 1

Expressions are equivalent. The error was that the full class name was not specified as a string-parameter of the forName () method of the Class object. Thanks avp for the hint!