- 博客(8)
- 收藏
- 关注
原创 字符流~~
public static void main(String[] args) throws IOException { File file = new File("ThreadDemo\\src\\Demo2\\a.txt"); BufferedWriter bw = new BufferedWriter(new FileWriter(file)); BufferedReader br = new BufferedReader(new FileReader(file)); .
2021-12-05 22:54:24 156
原创 TCP实现双人聊天
第一个人 package TestDemo; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.ServerSocket; import java.net.Socket; import java.util.Scanner; public class tcp01 { public static void main(String[] args){.
2021-11-29 22:49:42 242
原创 UDP实现多人聊天
package UDPword; import java.io.IOException; import java.net.*; import java.util.Scanner; public class test extends Thread{ public static void main(String[] args) throws IOException { int port = 10000; String name; MulticastS.
2021-11-29 22:42:57 476
原创 java写入文本到excel表格
public static void main(String[] args) throws IOException { Workbook workbook= new HSSFWorkbook(); HSSFSheet sheet= (HSSFSheet) workbook.createSheet("test"); List<String> data = data(); int b=0; for (String da : data) { HS...
2021-11-29 22:37:08 527
原创 遍历磁盘。。。
public static void main(String[] args) { File file = new File("D:\\"); cha(file); } private static void cha(File src) { File[] files = src.listFiles(); if (files != null) { for (File file : files) { if (file.isDirectory...
2021-10-20 09:17:52 78
原创 Java中jdbc操作
1、写SQL语句 a、create database phone_book; use phone_book;b、create table info (id char,name char(8),tel char(11),sex char(2));c、insert into info values ('1','艾琳','18702550410','女'); insert into info values ('2','老一','18702550411','男'); insert into ...
2021-09-27 20:36:30 103
原创 排序方法。
public class demo01 { public static Map<String, List<Employee>> groupByFirstChar(List<Employee> data){ Map<String, List<Employee>> result = new HashMap<>(); for(Employee e : data){ ...
2021-09-21 21:01:54 76
原创 数组反转、继承
99乘法表 数组反转 继承 public interface Fu { void fish(); void sheep(); } public interface Mu { void swim(); void sing(); } public interface Zi extends Fu,Mu{ void Playgame(); } public class zai implements Zi{ ...
2021-09-07 09:39:22 159
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人