Home » JAVA Programming » Java Basic » Question
  1. How method can be invoked on unknown object?
    1. obj.getClass().getObject()
    2. obj.getClass().getMethod()
    3. obj.getClass().getDeclaredField()
    4. obj.getClass().getDeclaredMethod()
    5. None of these
Correct Option: B

obj.getClass().getMethod is used to invoke a method on unknown object obj.



Your comments will be displayed only after manual approval.