摘要: 1.DOM对象-01 获取DOM元素 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <script> <!-- 当网页被加载时,浏览器会创建页面的文档对象模型(Docume 阅读全文
posted @ 2024-01-18 08:39 张心野 阅读(13) 评论(0) 推荐(0)
摘要: 1.File File常用函数 public static void main(String[] args) throws IOException { // 相对路径 : IO流默认目录 : 当前项目工程开始自己算 // 绝对路径 : 带盘符的路径 : // 网络路径 : https://img2. 阅读全文
posted @ 2023-12-29 12:25 张心野 阅读(10) 评论(0) 推荐(0)
摘要: 1.测试 测试 public class JiSuanQi { public int add(int a,int b){ return a + b; } public int jian(int a,int b){ return a - b; } public int cheng(int a,int 阅读全文
posted @ 2023-12-28 08:25 张心野 阅读(15) 评论(0) 推荐(0)
摘要: 1.线程 线程的休眠 public static void main(String[] args) { // 线程的休眠 // 第一种方式(不推荐): try { Thread.sleep(3000);// 毫秒 } catch (InterruptedException e) { e.printS 阅读全文
posted @ 2023-12-26 21:39 张心野 阅读(12) 评论(0) 推荐(0)
摘要: 1.IO流 序列化 public class Practice01 { public static void main(String[] args) throws IOException, ClassNotFoundException { // 一个数据 用变量 // 多个同类型数据 用数组 // 阅读全文
posted @ 2023-12-26 09:15 张心野 阅读(7) 评论(0) 推荐(0)
摘要: 4.面向对象的编程_抽象和多态 抽象 public class Practice { public static void main(String[] args) { Student.say(); } } public abstract class Student { /* abstract : 表 阅读全文
posted @ 2023-12-22 23:18 张心野 阅读(14) 评论(0) 推荐(0)
摘要: 1.常用时间类 Calendar类 public static void main(String[] args) { // JDK1.1开始 // Calendar类是一个抽象类, // 它提供了在特定时刻和一组日历字段(如YEAR、MONTH、DAY_of_MONTH、HOUR等)之间进行转换的方 阅读全文
posted @ 2023-12-22 23:18 张心野 阅读(11) 评论(0) 推荐(0)
摘要: 1.映射 HashMap public static void main(String[] args) { /* 嵌套类/内置类/内部类/内部接口 K : key V : value E : element R : ReturnType T : type Map<K, V> : 存储的是键值对。每个 阅读全文
posted @ 2023-12-22 23:17 张心野 阅读(27) 评论(0) 推荐(0)
摘要: 1.Collections常用工具 Collections常用工具 public static void main(String[] args) { List<String> list = new ArrayList<>(); list.add("ddd"); list.add("aaa"); li 阅读全文
posted @ 2023-12-22 23:17 张心野 阅读(8) 评论(0) 推荐(0)
摘要: 1.List ArrayList public static void main(String[] args) { // JDK8.0对集合进行有优化 // Collection 表示一组对象,这些对象也称为 collection 的元素。 // | List : 元素可以重复 ; 保证插入顺序和取 阅读全文
posted @ 2023-12-20 22:17 张心野 阅读(43) 评论(0) 推荐(0)