Java Reflection - Java Class.getSigners()








Syntax

Class.getSigners() has the following syntax.

public Object [] getSigners()

Example

In the following code shows how to use Class.getSigners() method.

//from  w w  w.  j av  a 2 s  .  co  m
public class Main {

  public static void main(String[] args) throws Exception{
    Class cls = Class.forName("Main");

    // returns the name of the class
    System.out.println("Class = " + cls.getName());

    Object[] obj = cls.getSigners();
    System.out.println("Value = " + obj);
  }
}

The code above generates the following result.