set Protected Modifier - Java Reflection

Java examples for Reflection:Modifier

Description

set Protected Modifier

Demo Code


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

public class Main {
    public static int setProtected(int modifier) {
        return modifier & (~Modifier.PUBLIC) & (~Modifier.PRIVATE)
                | (Modifier.PROTECTED);
    }//from  w  w w  .j a v  a  2  s.co m
}

Related Tutorials