Home » JAVA Programming » Java Basic » Question
  1. What does Class.forName(“myreflection.Foo”).getInstance() return?
    1. Foo object
    2. Calls the getInstance() method of Foo class
    3. class object of Foo
    4. An array of Foo objects
    5. None of these
Correct Option: A

Class.forName(“myreflection.Foo”) returns the class object of Foo and getInstance() would return a new object.



Your comments will be displayed only after manual approval.