通过反射攻击单例

star2017 1年前 ⋅ 2042 阅读
import java.lang.reflect.Constructor;

public class Test {
public static void main(String[] args) {
try {
Class<Runtime> clazz = Runtime.class;
Constructor<Runtime> constructor = clazz.getDeclaredConstructor();
constructor.setAccessible(true);
constructor.newInstance();
}catch (Exception e){
e.printStackTrace();
}
}
}


更多内容请访问:IT源点

相关文章推荐

全部评论: 0

    我有话说: