- 博客(10)
- 收藏
- 关注
原创 缓存输入输出
package lianxi; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import javax.swing.Box; import javax.swing.JButton; import javax.swing.JF
2021-12-08 19:28:03
51
原创 TCP实现双人聊天
package 练习; import java.io.IOException; import java.net.ServerSocket; import java.net.Socket; import java.util.Scanner; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; public class tcp01 { public static void ma..
2021-12-04 20:26:25
68
原创 文件读取操作
package 练习; import java.io.File; public class wenjian { public static void main(String[] args) { File file = new File("D:\\"); cha(file); } private static void cha(File src) { File[] files = src.listFiles(); i...
2021-12-04 20:22:58
403
原创 数据库操作
public static void main(String[] args) throws SQLException { getconn(); String selectsql="select * from info"; (所有查询代码为: select * from info where tel like '?%'; select * from info where sex=?; select * from info where tel like '?%'; select * from ...
2021-12-04 20:18:59
432
原创 Excel文件
public void excel(){ String[] titleA = {"id","student number","name"}; File fileA = new File("D:/TestFile.xls"); if(fileA.exists()){ fileA.delete(); } tr...
2021-12-04 09:41:32
89
原创 UDP多人聊天
package 练习; import java.io.IOException; import java.net.*; import java.util.Scanner; public class UDP extends Thread { public static void main(String[] args) throws IOException { int port = 10000; String name; MulticastSocket m...
2021-12-04 09:39:07
54
原创 java枚举
创建枚举: package zuoye; public enum xinxi { WS1,WS2,special,expert,common,nb } 使用枚举: package zuoye; public class Fengzu { public static void doit(xinxi a) { switch(a) { case WS1: System.out.println("车间号为WS1的员工工号有:W1,...
2021-09-28 09:52:44
54
原创 java质数
package 练习; public class 作业2 { public static void main(String[] args) { // TODO 自动生成的方法存根 int i,j; for(i=2;i<=100;i++) { for(j=2;j<=i/2;j++) { if(i%j==0) b...
2021-09-10 19:44:20
59
原创 Java继承
package 包; public interface father { public void booking(); public void fishing(); } package 包; public interface mother { public void drawing(); public void cooking(); } package 包; public class son implements fa...
2021-09-10 19:42:56
52
原创 java二维数组
package 练习; public class 作业1 { public static void main(String[] args) { // TODO 自动生成的方法存根 int arr[][]=new int[][]{{1,2,3},{4,5,6},{7,8,9}}; for(int i=0;i<arr.length;i++) { for(int j=0;j<arr.l...
2021-09-10 19:41:47
48
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人