set Public Modifier - Java Reflection

Java examples for Reflection:Modifier

Description

set Public Modifier

Demo Code


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

public class Main {
    public static int setPublic(int modifier) {
        return modifier & (~Modifier.PRIVATE) & (~Modifier.PROTECTED)
                | (Modifier.PUBLIC);
    }/*from   w w w  .  jav  a  2  s  .  c om*/
}

Related Tutorials