You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Learn/JavaCode/Jb36_AnsInnerClass2.java

46 lines
583 B

public class Jb36_AnsInnerClass2
{
/*
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ó<EFBFBD><EFBFBD><EFBFBD>֮һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǽӿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҽӿ<EFBFBD><EFBFBD>еķ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊʵ<EFBFBD>ʲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*/
public static void main(String[] args)
{
show(new Inf()
{
public void show1()
{}
public void show2()
{}
});
}
public static void show(Inf in)
{
in.show1();
in.show2();
}
}
interface Inf
{
void show1();
void show2();
}
//<2F><><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>
class Outer
{
public void method()
{
Inf in = new Inf()
{
public void show1()
{}
public void show2()
{}
};
in.show1();
in.show2();
}
}