package liu.temple.demo;
public abstract class TestPaper {
public void TestQuestion1(){
System.out.println("屠龙刀的玄铁可能是[]a.球形铸铁,b.马口铁,C.高速和金刚,d.碳素纤维");
System.out.println("答案是:"+Answer1());
}
public void TestQuestion2(){
System.out.println("1加1等于:[]a.1,b.2,c.4");
System.out.println("答案是:"+Answer2());
}
public void TestQuestion3(){
System.out.println("2加3等于:[]a.2,b.3,c.4,d.5");
System.out.println("答案是:"+Answer3());
}
public abstract String Answer3();
public abstract String Answer2();
public abstract String Answer1();
}
------------------------------------------------------
package liu.temple.demo;
System.out.println("屠龙刀的玄铁可能是[]a.球形铸铁,b.马口铁,C.高速和金刚,d.碳素纤维");
System.out.println("答案是:"+Answer1());
}
public void TestQuestion2(){
System.out.println("1加1等于:[]a.1,b.2,c.4");
System.out.println("答案是:"+Answer2());
}
public void TestQuestion3(){
System.out.println("2加3等于:[]a.2,b.3,c.4,d.5");
System.out.println("答案是:"+Answer3());
}
public abstract String Answer3();
public abstract String Answer2();
public abstract String Answer1();
}
------------------------------------------------------
package liu.temple.demo;
public class TestPaperA extends TestPaper{
@Override
public String Answer3() {
return "b";
}
public String Answer3() {
return "b";
}
@Override
public String Answer2() {
return "a";
}
public String Answer2() {
return "a";
}
@Override
public String Answer1() {
return "d";
}
public String Answer1() {
return "d";
}
}
------------------------------------------------------
package liu.temple.demo;
------------------------------------------------------
package liu.temple.demo;
public class TestPaperB extends TestPaper{
@Override
public String Answer3() {
return "c";
}
public String Answer3() {
return "c";
}
@Override
public String Answer2() {
// TODO Auto-generated method stub
return "b";
}
public String Answer2() {
// TODO Auto-generated method stub
return "b";
}
@Override
public String Answer1() {
// TODO Auto-generated method stub
return "c";
}
public String Answer1() {
// TODO Auto-generated method stub
return "c";
}
}
------------------------------------------------------
package liu.temple.demo;
------------------------------------------------------
package liu.temple.demo;
public class Main {
/**
* @param args
*/
public static void main(String[] args) {
TestPaper A = new TestPaperA();
A.TestQuestion1();
A.TestQuestion2();
A.TestQuestion3();
System.out.println("--------------------");
TestPaper B = new TestPaperB();
B.TestQuestion1();
B.TestQuestion2();
B.TestQuestion3();
* @param args
*/
public static void main(String[] args) {
TestPaper A = new TestPaperA();
A.TestQuestion1();
A.TestQuestion2();
A.TestQuestion3();
System.out.println("--------------------");
TestPaper B = new TestPaperB();
B.TestQuestion1();
B.TestQuestion2();
B.TestQuestion3();
}
}
------------------------------------------------------
------------------------------------------------------