日期:2014-05-20 浏览次数:20650 次
public abstract class Atest { String name; public Atest(String name){ this.name = name; } abstract void play(); } public interface TestInterface { void play(); } public class Test1 { Atest t = new Atest("ns"){ @Override void play() { // TODO Auto-generated method stub System.out.println("hello"); } }; TestInterface s = new TestInterface() { @Override public void play() { System.out.println("hello"); } }; }