• 抽象总结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()); } }
  • 相关阅读:
    java面试
    java多态
    java多线程
    Java操作ElasticSearch
    liunx安装jdk
    linux安装Elasticsearch详细步骤
    java IO流
    java递归
    File文件类
    redis单机多节点集群
  • 原文地址:https://www.cnblogs.com/yuanyuan2017/p/6561277.html
Copyright © 2020-2023  润新知