You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
1.6 KiB

/*
<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>еķ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>dz<EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Խ<EFBFBD><EFBFBD>ó<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ýӿڵ<EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͱ<EFBFBD>ʾ<EFBFBD><EFBFBD>
abstract class Demo
{
abstract void show1();
abstract void show2();
}
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿڵĹؼ<EFBFBD><EFBFBD><EFBFBD>interface
<EFBFBD>ӿڳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD>й̶<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>η<EFBFBD>
ȫ<EFBFBD>ֳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>public static final
<EFBFBD><EFBFBD><EFBFBD>󷽷<EFBFBD><EFBFBD><EFBFBD>public abstract
<EFBFBD>̽ӿ<EFBFBD><EFBFBD>еij<EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>public<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD>
*/
interface Demo
{
public static final int NUM = 4;
public abstract void show1();
public abstract void show2();
}
/*<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֮<EFBFBD><EFBFBD><EFBFBD>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BFBD>
<EFBFBD>ö<EFBFBD>ʵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD>ֶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿ<EFBFBD>
*/
interface A
{
public void show1();
}
interface B
{
public void show2();
}
class Test implements A,B //<2F><>ʵ<EFBFBD><CAB5>
{
public void show()
{
System.out.println("OK");
}
}
//һ<><D2BB><EFBFBD><EFBFBD><EFBFBD>̳<EFBFBD><CCB3><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬʱ<CDAC><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD>ӿ<EFBFBD>
class C
{
public void method()
{}
}
abstract class Test2 extends C implements A,B
{
}
public class Jb29_Interface
{
public static void main(String[] args)
{
/*DemoImpl inf = new DemoImpl();
System.out.println(inf.NUM);
System.out.println(DemoImpl.NUM);
System.out.println(Demo.NUM);*/
}
}
/*
<EFBFBD>ӿںͳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Dz<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϳ<EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD>ͬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD>̳У<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֻ<EFBFBD>ܵ<EFBFBD><EFBFBD>̳С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