public interface Contents {
public void star();
}
public class Goods {
public Contents cont() {
return new Contents() {
private String i = "heiheihei";
public String value() {
return i;
}
public void star() {
// TODO Auto-generated method stub
System.out.println(value());
}
};
}
}
@Test
public void test(){
Goods good = new Goods();
Contents cont= good.cont();
cont.star();
}