首页 新闻 会员 周边

java 里 这种写法 是什么意思?是实现接口吗?

0
悬赏园豆:5 [已关闭问题] 关闭于 2017-03-06 09:30

Authenticator auth =new Authenticator(){
  protected PasswordAuthentication getPasswordAuthentication(){
    return new PasswordAuthentication(smtpUsername, smtpPassword);
  }
};

 

这种写法感觉很怪异? 是什么? 哪个版本引入的特性?

 

是提供一个新的接口实现类的实例吧?

算了的主页 算了 | 初学一级 | 园豆:3
提问于:2017-03-06 09:27
< >
分享
所有回答(1)
0

匿名内部类。。。。关闭问题

算了 | 园豆:3 (初学一级) | 2017-03-06 09:30
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册