抽象总结demo

package jichengdemo;

import java.nio.charset.MalformedInputException;

public class ChouXiangDemo {
    public static void main(String[] args) {
        studentgg s = new studentgg();
        s.setname("lixianghua");
        s.setschool("beida");
        s.print();
    }
}
abstract class personpp{     //抽象类

public static final String FLAG="CHINA"; private String name; public void setname(String name){ this.name = name; } public String getname(){ return name; } public abstract void print(); //抽象方法 } class studentgg extends personpp{ private String school; public void setschool(String school){ this.school = school; } public String getschool(){ return school; } public void print(){ System.out.println("FLAG :"+FLAG); System.out.println(super.getname()+"*****"+this.getschool()); } }

 

posted @ 2017-03-16 19:54  初学者,方圆几里  阅读(74)  评论(0编辑  收藏  举报