如何查看 Proxy 模式的 $ProxyX.class文件

在學習 Proxy 的實現原理時我們要查看 $Proxy0.class 的代碼,由於 $Proxy0.class 是在內存中的,所以我們需要寫到本地。廢話不多說,方式如下: 在調用動態代理的main方法中加上 System.getProperties().put("sun.misc.ProxyGenerator.saveGeneratedFiles", "true"); System.ge
相關文章
相關標籤/搜索