上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 34 下一页
摘要: //获取class对象的三种方法 public class ReflectDemo1 { public static void main(String[] args) throws ClassNotFoundException { //1.通过class属性获取 Class<Student> stu 阅读全文
posted @ 2021-05-03 22:03 code-G 阅读(1158) 评论(0) 推荐(0) 编辑
摘要: 流最终可以收集为Collection,set,Map import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; //集合得收集操作 public class StreamDemo5 阅读全文
posted @ 2021-05-03 18:27 code-G 阅读(94) 评论(0) 推荐(0) 编辑
摘要: 终结操作后无法有后续操作的,因为流已经结束 import java.util.ArrayList; //流式编程终结操作 public class StreamDemo4 { public static void main(String[] args) { ArrayList<String> str 阅读全文
posted @ 2021-05-03 18:25 code-G 阅读(142) 评论(0) 推荐(0) 编辑
摘要: import java.sql.SQLOutput; import java.util.ArrayList; import java.util.stream.Stream; //流式编程得中间操作 public class StreamDemo3 { public static void main( 阅读全文
posted @ 2021-05-03 18:24 code-G 阅读(80) 评论(0) 推荐(0) 编辑
摘要: 流: 集合流 Map流 数组流 import java.util.ArrayList; import java.util.HashMap; import java.util.Map; import java.util.stream.Stream; //几种流的生成方式 public class St 阅读全文
posted @ 2021-05-03 18:23 code-G 阅读(140) 评论(0) 推荐(0) 编辑
摘要: import java.util.ArrayList; public class StreamDemo1 { public static void main(String[] args) { ArrayList<String> strings = new ArrayList<>(); strings 阅读全文
posted @ 2021-05-03 18:21 code-G 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 基本都是使用lambda表达式重写方法 Supplier import java.util.function.Supplier; //生产数据的接口 public class SupplierDemo { public static void main(String[] args) { //lamb 阅读全文
posted @ 2021-05-03 16:55 code-G 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 客户端 import java.io.*; import java.net.InetAddress; import java.net.Socket; public class Client { public static void main(String[] args) throws IOExcep 阅读全文
posted @ 2021-05-02 22:20 code-G 阅读(91) 评论(0) 推荐(0) 编辑
摘要: 客户端 import java.io.IOException; import java.io.OutputStream; import java.net.InetAddress; import java.net.Socket; import java.net.UnknownHostException 阅读全文
posted @ 2021-05-02 19:34 code-G 阅读(178) 评论(0) 推荐(0) 编辑
摘要: import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; /* UDP接收数据: 因为接收端不知道发送端什么时候停止发送,故采用死循环接收 */ public class R 阅读全文
posted @ 2021-05-02 19:33 code-G 阅读(276) 评论(0) 推荐(0) 编辑
上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 34 下一页