1 package com.example; 2 interface A{ 3 public final String name = "xiaoyu"; 4 public abstract void tell(); 5 6 } 7 8 class People implements A{ 9 10 @Override11 public void tell() {12 System.out.print(name);13 }14 }15 16 public class MyClass {17 //1.接口里面全部是由全局常量和公共的抽象方法所组成18 public static void main(String[] args){19 People p = new People();20 p.tell();21 }22 }