摘要:
接口定义 public interface Converter { int convert(String s); } View Code 测试类定义 public class ConverterDemo { public static void main(String[] args) { //使用L 阅读全文
摘要:
接口定义 public interface Printable { void printString(String s); } 测试类 public class PrintableDemo { public static void main(String[] args) { //使用Lambda表达 阅读全文
摘要:
接口定义 public interface Addable { int add(int x , int y); } public interface Flyable { void fly(String s); } View Code 测试类定义 public class LambdaDemo { p 阅读全文
摘要:
接口定义 public interface Addable { int add(int x, int y); } View Code 测试类定义 public class AddableDemo { public static void main(String[] args) { //匿名内部类 / 阅读全文
摘要:
接口定义 public interface Flyable { void fly(String s); } View Code 测试类 public class FlyableDemo { public static void main(String[] args) { //使用匿名内部类 useF 阅读全文
摘要:
接口定义 public interface Eatable { void eat(); } View Code 接口实现类 public class EatableImp implements Eatable{ @Override public void eat() { System.out.pri 阅读全文
摘要:
public class LambdaDemo { public static void main(String[] args) { //正常实现一个多线程程序 MyRunnable mr = new MyRunnable(); Thread t = new Thread(mr); t.start( 阅读全文