上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 21 下一页
摘要: public class SupplierDemo { public static void main(String[] args) { String s = getString(()->"函数式接口"); System.out.println(s); Integer i = getInteger( 阅读全文
posted @ 2020-06-06 17:20 硬盘红了 阅读(144) 评论(0) 推荐(0) 编辑
摘要: public class ComparatorDemo { public static void main(String[] args) { ArrayList<String> array = new ArrayList<>(); array.add("a"); array.add("ccccc") 阅读全文
posted @ 2020-06-06 17:01 硬盘红了 阅读(243) 评论(0) 推荐(0) 编辑
摘要: public class RunnableDemo { public static void main(String[] args) { //使用匿名类调用方法 startThread(new Runnable() { @Override public void run() { System.out 阅读全文
posted @ 2020-06-05 16:18 硬盘红了 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 定义接口 public interface StudentBuilder { Student build(String name, int age); } View Code 测试类 public class StudentDemo { public static void main(String[ 阅读全文
posted @ 2020-05-19 17:53 硬盘红了 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 接口定义 public interface MyString { String mySubString(String s,int x,int y); } View Code 测试类 public class MyStringDemo { public static void main(String[ 阅读全文
posted @ 2020-05-19 17:11 硬盘红了 阅读(426) 评论(0) 推荐(0) 编辑
摘要: 接口定义 public interface Print { void printUpperCase(String s); } View Code PrintString类 public class PrintString { public void printUpper(String s){ Str 阅读全文
posted @ 2020-05-19 16:47 硬盘红了 阅读(536) 评论(0) 推荐(0) 编辑
摘要: 接口定义 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) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 21 下一页