标签:http ott down 实现 源码 ttl point .com win
1.Interface接口的定义和用法 (视频下载) (全部书籍)
先直接上大白话:马克-to-win:接口就是灰常灰常抽象的抽象类,我们可以就像用抽象类一样用接口,只不过,interface抽象到不能再抽象了,以至于里面不能有任何方法的实现, 只能都是空方法。紧接着来个例子:
例1.1---本章源码
interface OpenClose {
void open();
void close();
}
class Shop_mark_to_win implements OpenClose {
public void open() {
System.out.println("商店开门了---shop open");
}
public void close() {
System.out.println("商店关门了---shop close");
}
}
class Bottle_mark_to_win implements OpenClose {
public void open() {
System.out.println("打开瓶子,Open the Bottle");
}
public void close() {
System.out.println("盖上瓶子Close the Bottle");
}
}
public class Test {
public static void main(String args[]) {
OpenClose s = new Shop_mark_to_win();
s.open();
s.close();
OpenClose b = new Bottle_mark_to_win();
b.open();
b.close();
System.out.println("-----------------");
OpenClose[] x = { s, b };
for (int i = 0; i < x.length; i++) {
。。。。。。。。。。。。。。。。。
详情请进:http://www.mark-to-win.com/index.html?content=JavaBeginner/javaUrl.html&chapter=JavaBeginner/JavaBeginner4_web.html#PointInterface
标签:http ott down 实现 源码 ttl point .com win
原文地址:https://www.cnblogs.com/mark-to-win/p/9693626.html