set Private Modifier - Java Reflection

Java examples for Reflection:Modifier

Description

set Private Modifier

Demo Code


//package com.java2s;
import java.lang.reflect.Modifier;

public class Main {
    public static int setPrivate(int modifier) {
        return modifier & (~Modifier.PUBLIC) & (~Modifier.PROTECTED)
                | (Modifier.PRIVATE);
    }/*from  w  w w . j  av a  2  s .c o  m*/
}

Related Tutorials