What is reflect package used for & the methods of it.

Showing Answers 1 - 1 of 1 Answers

sheelilouis

  • Apr 19th, 2007
 

Thisb java.lang.reflect package is uesd retrieve the member info for any loaded class.

for example,
Class c=Class.forName("java.lang.String");
Method m[]=c.getDeclaredMethods();

now m contains all  declared method for String class

here String is loaded class.

this package provides classes such as Method,Modifier,Field,Constructor,Proxy etc..by using these we retrieve the needed info of the loaded class

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions