摘要:
public static void main(String[] args) { String s = s(() → { return "是"; }); System.out.println(s); } public static String s(Supplier<String> pp){ ret 阅读全文
posted @ 2020-12-19 20:37
七0
阅读(64)
评论(0)
推荐(0)
摘要:
@FunctionalInterface注解 与@Override注解作用类似,Java 8中专门为函数式接口引入的一个新注解@FunctionalInterface,该注解主要定义在接口上。一旦在接口上使用该注解,编译期将会强制检查该接口是不是一个函数式接口,该接口中是不是有且仅有一个抽象方法,如 阅读全文
posted @ 2020-12-19 20:35
七0
阅读(170)
评论(0)
推荐(0)
摘要:
public static void main(String[] args) { // 构建一个集合 List list = new ArrayList(); list.add("abc123"); list.add("aaa22"); list.add("bcd125"); list.add("a 阅读全文
posted @ 2020-12-19 20:34
七0
阅读(491)
评论(0)
推荐(0)
摘要:
// 1.定义多个对象,存储在集合中 ArrayList list = new ArrayList<>(); list.add(new Student("小孙",30)); list.add(new Student("小王",20)); list.add(new Student("小赵",40)); 阅读全文
posted @ 2020-12-19 09:29
七0
阅读(81)
评论(0)
推荐(0)
摘要:
//1.创建ObjectOutputStream流对象,构造方法中传递指定的字节输出流。 ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("day30_IO\student.txt")); //2.使用Obje 阅读全文
posted @ 2020-12-19 09:28
七0
阅读(260)
评论(0)
推荐(0)
摘要:
//1.1 使用指定GBK编码的转换流,读取文本文件。InputStreamReader final InputStreamReader isr = new InputStreamReader(new FileInputStream("day30_IO\GBK.txt"), "GBK"); //1. 阅读全文
posted @ 2020-12-19 09:22
七0
阅读(167)
评论(0)
推荐(0)
浙公网安备 33010602011771号