Print out the declared methods on java.lang.Number in Java

Description

The following code shows how to print out the declared methods on java.lang.Number.

Example


//from   ww w.j a  v  a 2s  . co m
import java.lang.reflect.Method;
public class Main {
  public static void main(final String[] args) {
    final Method[] methods = Number.class.getDeclaredMethods();
    for (int idx = 0; idx < methods.length; idx++) {
      System.out.println(methods[idx]);
    }
  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    Reflection »




Annotation
Array
Class
Constructor
Field
Generics
Interface
Method
Modifier
Package
Proxy