- 博客(210)
- 资源 (5)
- 收藏
- 关注
原创 Properties 读取文件数据;key-value
Properties properties = new Properties(); FileReader fileReader = new FileReader("src\\33.txt"); properties.load(fileReader); fileReader.close(); String className = properties.getProperty("className"); String clas..
2022-05-14 20:17:07
246
原创 3中方法:启动一个线程;并且输出一句话
public static void main(String[] args) { //启动一个线程;并且输出一句话 //方法一:实现一个Runnable接口 MyRunnable myRunnable = new MyRunnable(); Thread thread = new Thread(myRunnable); thread.start(); //方法二:匿名内部类 new Thread(new Runnable() { .
2022-05-14 20:16:07
135
原创 Lambda表达式的省略模式 、 注意事项、和匿名内部类的区别
useFlyable((String s) -> { System.out.println(s); }); useFlyable(x -> System.out.println(x) ); System.out.println("=============================="); // useAdd((...
2022-05-14 16:46:40
98
原创 Oracle alter 修改表名、列名、数据类型、插入列、删除列
ALTER 语句修改数据表alter 语句修改数据表1.修改数据表名alter table [方案名.]old_table_name rename to new_table_name;2.修改列名alter table [方案名.]table_name rename column old_column_name to new_column_name;3.修改列的数据类型alter table [方案名.]table_name modify column_name new_data
2022-05-12 11:58:49
3648
原创 网路编程概述
public static void main(String[] args) throws UnknownHostException { // InetAddress address = InetAddress.getByName("192.168.1.121"); InetAddress address = InetAddress.getByName("myPc"); String hostAddress = addre...
2022-05-04 19:17:21
225
原创 java线程调度
public static void main(String[] args) { ThreadPriority tp1 = new ThreadPriority(); ThreadPriority tp2 = new ThreadPriority(); ThreadPriority tp3 = new ThreadPriority(); tp1.setName("汽车"); tp2.setName("高铁"); ...
2022-05-03 21:37:24
121
原创 多线程的实现方式--继承Thread类、实现Runnable接口
public static void main(String[] args) { //一:多线程,默认线程名称 MyThread my1 = new MyThread(); MyThread my2 = new MyThread(); my1.start(); my2.start(); //二:多线程,setName线程名称 MyThread my11 = new MyThread...
2022-05-03 21:13:25
365
原创 对象序列化流和反序列化流
public static void main(String[] args) throws Exception { writeObject(); readObject(); } /** * 反序列化 */ private static void readObject() throws IOException, ClassNotFoundException { ObjectInputStream oi...
2022-05-03 18:38:49
387
原创 打印流-复制文件
public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new FileReader("11.txt")); BufferedWriter bw = new BufferedWriter(new FileWriter("22.txt")); String line; while ((line = br..
2022-05-02 21:15:43
52
用300行代码手写Spring V1.0版本
2022-05-29
JDK-Window系统-java开发环境安装文档
2022-05-29
java 自定义异常-编译异常和运行异常
2022-04-08
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人