dcsimg
Command to find all methods
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   raja_sankar
Posted On:   Thursday, June 12, 2003 02:23 AM

How to find all the methods of a particular package in Command prompt. for example i want to know all the methods in java.util.GregorianCalendar Package .

Re: Command to find all methods

Posted By:   Bahman_Barzideh  
Posted On:   Thursday, June 12, 2003 05:06 AM

If you are trying to get the methods of a class from the command prompt, you can use javap with the -private option. This will prints the signature of all methods (including those of inner classes) to the screen. Run javap -help for more information



If you are trying to get this information programmatically, you will need to use reflections.

Re: Command to find all methods

Posted By:   Anonymous  
Posted On:   Thursday, June 12, 2003 04:16 AM

A package doesn´t have methods. For a list of all methods you can consult the javadocs or use reflection. I don´t know any command-prompt way. Of course you can write a program like

  1. load class specified as argument

  2. instantiate that class

  3. use reflection on that class

  4. print the list of methods


Another way is to use IDEs. IDEs usually use reflection to give you hints (e.g. code completion).
About | Sitemap | Contact