Java Modifier.toString(int mod)

Syntax

Modifier.toString(int mod) has the following syntax.

public static String toString(int mod)

Example

In the following code shows how to use Modifier.toString(int mod) method.


/*ww w . j  av  a  2 s  .co m*/
import java.lang.reflect.Constructor;
import java.lang.reflect.Modifier;

public class Main {
  public static void main(String... args) throws Exception {
    Class<?> c = Class.forName("java.lang.String");
    Constructor[] allConstructors = c.getDeclaredConstructors();
    for (Constructor ctor : allConstructors) {

      Modifier.toString(ctor.getModifiers());
    
    }
  }

}




















Home »
  Java Tutorial »
    java.lang.reflect »




Array
Constructor
Field
Method
Modifier
ParameterizedType
TypeVariable