How do I list the declared methods of a class?
Author: Deron Eriksson
Description: This Java tutorial describes how to use the Class object's getDeclaredMethods() method.
Tutorial created using: Windows XP || JDK 1.5.0_09 || Eclipse Web Tools Platform 1.5.4


Page: < 1 2

(Continued from page 1)

Executing the ClassMethodTest class displays the signatures of all the methods declared by the Testing class:

method: private java.lang.String test.Testing.getPrivateDude()
method: private void test.Testing.setPrivateDude(java.lang.String)
method: protected java.lang.String test.Testing.getProtectedDude()
method: protected void test.Testing.setProtectedDude(java.lang.String)
method: public boolean test.Testing.isBoolean1()
method: public void test.Testing.setBoolean1(boolean)
method: public java.lang.String test.Testing.getString1()
method: public void test.Testing.setString1(java.lang.String)

The Method class will be further investigated in other tutorials.

Page: < 1 2