Java Modifier.isStatic(int mod)

Syntax

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

public static boolean isStatic(int mod)

Example

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


import java.lang.reflect.Modifier;
// ww w .jav  a  2  s . co  m
public class Main {
  public static void main(String[] args) throws Exception {
    Class<?> clazz = String.class;
    int modifier = clazz.getModifiers();

    if (Modifier.isStatic(modifier)) {
      System.out.println("isStatic");
    }
  }
}




















Home »
  Java Tutorial »
    java.lang.reflect »




Array
Constructor
Field
Method
Modifier
ParameterizedType
TypeVariable