
本文共 3045 字,大约阅读时间需要 10 分钟。
���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
���������������
������������ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
��������������� ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
���������������
-
���
���Java������������������interface
���������������public interface
���������������������������������implements
������������������public class MyInterfaceImpl implements MyInterface {
-
���������������������
���������������������������������new
������������������������������������������������������������������������������������ -
���������������������
������������������������������������������������������������������������������������������������������������������������������������������������
���������������������
���������������������������������������������������������������������������������
-
������������
������������������������������������������������public static final
������������public static final String LOGGER = "���������������";
-
������������
��������������������������������������������������������������������������������������������� ��������������� -
������������
���Java 1.7���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
���������������
// ������public interface MyInterface { // ������ static final int DEFAULT_VALUE = 42; // ������������ void doSomething();}// ���������public class MyInterfaceImpl implements MyInterface { public void doSomething() { System.out.println("������������������������"); }}// ���������public class TestInterface { public static void main(String[] args) { MyInterfaceImpl impl = new MyInterfaceImpl(); impl.doSomething(); System.out.println(MyInterface.DEFAULT_VALUE); }}
������������������
-
���������������������������������
���������public class MyClass implements MyInterface1, MyInterface2 {
-
������������������������ ������������
������������������������������������������������������������������������������������
������������������
���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������������������������������
发表评论
最新留言
关于作者
