摘要: 接口定义 public interface Converter { int convert(String s); } View Code 测试类定义 public class ConverterDemo { public static void main(String[] args) { //使用L 阅读全文
posted @ 2020-05-15 20:27 硬盘红了 阅读(270) 评论(0) 推荐(1) 编辑
摘要: 接口定义 public interface Printable { void printString(String s); } 测试类 public class PrintableDemo { public static void main(String[] args) { //使用Lambda表达 阅读全文
posted @ 2020-05-15 18:01 硬盘红了 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 接口定义 public interface Addable { int add(int x , int y); } public interface Flyable { void fly(String s); } View Code 测试类定义 public class LambdaDemo { p 阅读全文
posted @ 2020-05-15 15:24 硬盘红了 阅读(574) 评论(0) 推荐(0) 编辑
摘要: 接口定义 public interface Addable { int add(int x, int y); } View Code 测试类定义 public class AddableDemo { public static void main(String[] args) { //匿名内部类 / 阅读全文
posted @ 2020-05-15 15:00 硬盘红了 阅读(235) 评论(0) 推荐(0) 编辑
摘要: 接口定义 public interface Flyable { void fly(String s); } View Code 测试类 public class FlyableDemo { public static void main(String[] args) { //使用匿名内部类 useF 阅读全文
posted @ 2020-05-15 13:01 硬盘红了 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 接口定义 public interface Eatable { void eat(); } View Code 接口实现类 public class EatableImp implements Eatable{ @Override public void eat() { System.out.pri 阅读全文
posted @ 2020-05-15 12:39 硬盘红了 阅读(434) 评论(0) 推荐(0) 编辑
摘要: public class LambdaDemo { public static void main(String[] args) { //正常实现一个多线程程序 MyRunnable mr = new MyRunnable(); Thread t = new Thread(mr); t.start( 阅读全文
posted @ 2020-05-15 12:10 硬盘红了 阅读(115) 评论(0) 推荐(0) 编辑