Authenticator auth =new Authenticator(){ protected PasswordAuthentication getPasswordAuthentication(){ return new PasswordAuthentication(smtpUsername, smtpPassword); }};
这种写法感觉很怪异? 是什么? 哪个版本引入的特性?
是提供一个新的接口实现类的实例吧?
微信里点“发现”,扫一下
二维码便可将本文分享至朋友圈。
匿名内部类。。。。关闭问题