Java Modifier.isTransient(int mod)

Syntax

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

public static boolean isTransient(int mod)

Example

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


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

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




















Home »
  Java Tutorial »
    java.lang.reflect »




Array
Constructor
Field
Method
Modifier
ParameterizedType
TypeVariable