/** * Created by hero on 17-2-18. */ publicclassTestPaperAextendsTestPaper { public String answer1() { return"随便"; }
public String answer2() { return"可能"; } }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
package template.method;
/** * Created by hero on 17-2-18. */ publicclassTestPaperBextendsTestPaper { public String answer1() { return"男的啊"; }
public String answer2() { return"不会"; } }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
package template.method;
/** * Created by hero on 17-2-18. */ publicclassMain { publicstaticvoidmain(String[] args) { TestPapertp1=newTestPaperA(); TestPapertp2=newTestPaperB();