求大神给讲讲

Harold_Fry Harold_Fry 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
interface Inter
{
void show1();
void show2();
}
class Outer
{
public void method()
{
Inter in=new Inter()
{
public void show1()
{
System.out.print("show1");
}
public void show2()
{
System.out.print("show2");
}
};
in.show1();
in.show2();
}
}
class hello
{
public static void main(String [] args)
{
show(new Inter()
{
public void show1(){}
public void show2(){}
});
}

public static void show(Inter in)
{
in.show1();
in.show2();
}
}

有点看不太懂,求大神给讲讲
...全文

相关推荐

评论 1
收藏 已收藏
分享
返回顶部
Harold_Fry
Java SE 62,620 成员 307,251 内容