This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Here are three of the four ways to get the Class object of a type.
Joined: Mar 05, 2003
Here is a program from Cay Horstmann's Core Java Volume I Chapter 5. When you are studying Threads, or Strings or the wrapper classes, and you want a list of all the methods, run this program. >ReflectionTest Thread You enter a class name and Cay uses forName to get the class object. Once he has the class object, he inquires about all the members of the class.
You can modify it, if you do not want to see the fields or the private members. [ October 13, 2003: Message edited by: Marlene Miller ]