当前位置: 首页 > news >正文

JavaSE之 常用 API 详解(附代码示例)

JavaSE之 常用 API 详解(附代码示例)

在 Java 开发中,API(Application Programming Interface)是提高开发效率的核心工具。本文整理了日常开发中最常用的 10大类API,包含核心功能、使用场景、代码示例,适合新手入门学习与开发参考。

一、Math 类:数学运算工具类

1. Math 类核心特点

  • 概述:Java 提供的数学运算工具类,无需创建对象即可使用。
  • 核心特点
    • 构造方法私有(无法通过 new 创建对象);
    • 所有成员方法均为静态方法(直接通过 Math.方法名() 调用)。

2. Math 类常用方法

方法声明功能描述
static int abs(int a)求参数的绝对值
static double ceil(double a)向上取整(如 10.1 → 11.0)
static double floor(double a)向下取整(如 10.9 → 10.0)
static long round(double a)四舍五入(如 10.5 → 11,10.4 → 10)
static int max(int a, int b)求两个数的较大值
static int min(int a, int b)求两个数的较小值

3. 代码示例

package com.code.day14;public class Day14Math {public static void main(String[] args) {// 1. 取绝对值System.out.println(Math.abs(-10)); // 输出:10System.out.println(Math.abs(10));  // 输出:10// 2. 向上取整System.out.println(Math.ceil(10.1));  // 输出:11.0System.out.println(Math.ceil(-5.2));  // 输出:-5.0// 3. 向下取整System.out.println(Math.floor(10.4)); // 输出:10.0System.out.println(Math.floor(-5.2)); // 输出:-6.0// 4. 四舍五入System.out.println(Math.round(10.4)); // 输出:10System.out.println(Math.round(10.5)); // 输出:11System.out.println(Math.round(-5.2)); // 输出:-5System.out.println(Math.round(-5.5)); // 输出:-5// 5. 最大值和最小值System.out.println(Math.max(10, 20)); // 输出:20System.out.println(Math.min(10, 20)); // 输出:10}
}

二、BigInteger 类:超大整数处理类

1. BigInteger 类核心场景

  • 问题背景long 是 Java 中能表示的最大基本整数类型(范围:-9223372036854775808 ~ 9223372036854775807),当需要处理超过 long 范围的整数时,需使用 BigInteger
  • 核心作用:处理任意大小的整数,无精度损失。

2. BigInteger 类常用方法

构造方法/方法声明功能描述
BigInteger(String val)构造方法:将字符串格式的整数转为 BigInteger 对象(val 必须是整数格式,如 “123456”)
BigInteger add(BigInteger val)加法:返回 this + val 的结果
BigInteger subtract(BigInteger val)减法:返回 this - val 的结果
BigInteger multiply(BigInteger val)乘法:返回 this * val 的结果
BigInteger divide(BigInteger val)除法:返回 this / val 的结果(需确保能整除,否则抛异常)

三、BigDecimal 类:高精度小数处理类

1. BigDecimal 类核心场景

  • 问题背景doublefloat 是浮点型,直接运算会出现精度损失(如 0.1 + 0.2 = 0.30000000000000004),BigDecimal 可解决此问题。
  • 核心作用:处理高精度小数运算,避免精度损失。

2. BigDecimal 类常用方法

构造方法/方法声明功能描述
BigDecimal(String val)构造方法:推荐使用,避免精度损失(如 new BigDecimal("0.1")
static BigDecimal valueOf(double val)静态方法:将 double 转为 BigDecimal(内部处理了精度问题,也推荐使用)
BigDecimal add(BigDecimal val)加法:返回 this + val 的结果
BigDecimal subtract(BigDecimal val)减法:返回 this - val 的结果
BigDecimal multiply(BigDecimal val)乘法:返回 this * val 的结果
BigDecimal divide(BigDecimal divisor, int scale, RoundingMode roundingMode)除法:指定保留小数位数(scale)和舍入模式(roundingMode),避免除不尽异常

3. 关键说明:除法舍入模式

舍入模式(RoundingMode 枚举)功能描述
RoundingMode.UP向上取整(如 1.234 保留 2 位 → 1.24)
RoundingMode.DOWN向下取整(如 1.239 保留 2 位 → 1.23)
RoundingMode.HALF_UP四舍五入(如 1.235 保留 2 位 → 1.24)

4. 代码示例

package com.code.day14;import java.math.BigDecimal;
import java.math.RoundingMode;public class Day14BigDecimal {public static void main(String[] args) {// 1. 创建 BigDecimal 对象(推荐 valueOf 或 String 构造)BigDecimal b1 = BigDecimal.valueOf(3.55);BigDecimal b2 = BigDecimal.valueOf(2.12);// 2. 加法BigDecimal add = b1.add(b2);System.out.println("加法结果:" + add); // 输出:5.67// 3. 减法BigDecimal subtract = b1.subtract(b2);System.out.println("减法结果:" + subtract); // 输出:1.43// 4. 乘法BigDecimal multiply = b1.multiply(b2);System.out.println("乘法结果:" + multiply); // 输出:7.5260// 5. 除法(指定保留 2 位小数,四舍五入)BigDecimal divide = b1.divide(b2, 2, RoundingMode.HALF_UP);System.out.println("除法结果:" + divide); // 输出:1.67}
}

四、Date 类:日期时间表示类

1. Date 类核心特点

  • 概述:表示特定的瞬间,精确到毫秒。
  • 关键常识
    • 时间原点:1970年1月1日0时0分0秒(UTC时区);
    • 北京时区:东8区,比时间原点快8小时;
    • 1秒 = 1000毫秒。

2. Date 类常用方法

构造方法/方法声明功能描述
Date()构造方法:创建表示当前系统时间的 Date 对象
Date(long time)构造方法:创建表示指定毫秒值对应的 Date 对象(time 为从时间原点开始的毫秒数)
void setTime(long time)设置 Date 对象对应的毫秒值
long getTime()获取 Date 对象对应的毫秒值

3. 代码示例

package com.code.day14;
import java.util.Date;public class Day14Date {public static void main(String[] args) {// 1. 创建表示当前时间的 Date 对象Date date = new Date();System.out.println("当前时间:" + date);// 2. 设置时间为“时间原点 + 1000毫秒”(即 1970-01-01 08:00:01)date.setTime(1000L);System.out.println("设置后的时间:" + date);// 3. 获取时间对应的毫秒值long timeMillis = date.getTime();System.out.println("对应的毫秒值:" + timeMillis); // 输出:1000}
}

五、Calendar 类:日历操作类

1. Calendar 类核心特点

  • 概述:抽象类,用于操作日历字段(年、月、日、时、分、秒等),不能直接 new 对象,需通过静态方法获取实例。
  • 关键注意
    • 月份从 0 开始(0 = 1月,1 = 2月,…,11 = 12月);
    • 每周从周日开始(0 = 周日,1 = 周一,…,6 = 周六)。

2. Calendar 类常用方法

方法声明功能描述
static Calendar getInstance()获取 Calendar 实例(默认当前系统时间和时区)
int get(int field)获取指定日历字段的值(field 为 Calendar 静态常量,如 Calendar.YEARCalendar.MONTH
void set(int field, int value)设置指定日历字段的值(如 calendar.set(Calendar.YEAR, 2024)
void add(int field, int amount)为指定日历字段增减值(amount 为正数则加,负数则减,如 calendar.add(Calendar.MONTH, 1) 表示加1个月)
Date getTime()将 Calendar 对象转为 Date 对象

3. 实战场景:判断闰年

package com.code.day14;import java.util.Calendar;
import java.util.Scanner;public class Day14CalendarKuoZhan {public static void main(String[] args) {Scanner scanner = new Scanner(System.in);System.out.println("请输入一个年份:");int year = scanner.nextInt();// 1. 获取 Calendar 实例Calendar calendar = Calendar.getInstance();// 2. 设置时间为“输入年份的 3月1日”(3月对应月份值为 2)calendar.set(year, 2, 1);// 3. 减 1 天 → 得到 2月的最后一天calendar.add(Calendar.DATE, -1);// 4. 获取 2月最后一天的日期(若为 29,则是闰年)int day = calendar.get(Calendar.DATE);if (day == 29) {System.out.println(year + "是闰年");} else {System.out.println(year + "不是闰年");}scanner.close();}
}

六、SimpleDateFormat 类:日期格式化类

1. SimpleDateFormat 类核心作用

  • 概述DateFormat 的子类,用于实现 Date 对象与字符串的相互转换
  • 核心功能
    • 格式化(Format):将 Date 对象按指定格式转为字符串;
    • 解析(Parse):将符合格式的字符串转为 Date 对象。

2. 关键:日期格式占位符

占位符含义示例
yyyy4位年份2024
MM2位月份(01~12)09
dd2位日期(01~31)03
HH24小时制小时(00~23)14
mm2位分钟(00~59)30
ss2位秒(00~59)59

注意:连接符可自定义(如 -/ 等),但占位符不可变(如年份必须用 yyyy,不能用 xxxx)。

3. 代码示例

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;public class Day14SimpleDateFormat {public static void main(String[] args) throws ParseException {// 1. 格式化:Date → StringDate now = new Date();// 指定格式:yyyy-MM-dd HH:mm:ssSimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");String dateStr = sdf1.format(now);System.out.println("格式化后的日期:" + dateStr); // 示例:2024-09-03 14:30:59// 2. 解析:String → Date(字符串格式必须与指定格式一致,否则抛 ParseException)String targetStr = "2019-10-10 10:10:10";SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");Date targetDate = sdf2.parse(targetStr);System.out.println("解析后的 Date 对象:" + targetDate); // 示例:Thu Oct 10 10:10:10 CST 2019}
}

七、JDK8 新日期类(LocalDate/LocalDateTime 等)

JDK8 之前的 DateCalendar 存在线程不安全、API 设计混乱等问题,因此新增了 java.time 包,包含 LocalDateLocalDateTimePeriodDurationDateTimeFormatter 等类,解决了旧 API 的缺陷。

1. LocalDate:日期(年月日)

1.1 核心方法
方法声明功能描述
static LocalDate now()获取当前日期(年月日)
static LocalDate of(int year, int month, int dayOfMonth)创建指定年月日的 LocalDate 对象(月份从 1 开始,无需加 1)
LocalDate withYear(int year)修改年份,返回新对象(不可变类,原对象不变)
LocalDate withMonth(int month)修改月份,返回新对象
LocalDate withDayOfMonth(int day)修改日期,返回新对象
LocalDate plusYears(int years)增加年份,返回新对象
LocalDate minusYears(int years)减少年份,返回新对象
1.2 代码示例
package com.code.day14;import java.time.LocalDate;public class Day14LocalDate {public static void main(String[] args) {// 1. 获取当前日期LocalDate now = LocalDate.now();System.out.println("当前日期:" + now); // 示例:2024-09-03// 2. 创建指定日期(2020年10月10日)LocalDate targetDate = LocalDate.of(2020, 10, 10);System.out.println("指定日期:" + targetDate); // 输出:2020-10-10// 3. 修改日期(修改为 2024年10月10日)LocalDate modifiedDate = now.withYear(2024).withMonth(10).withDayOfMonth(10);System.out.println("修改后日期:" + modifiedDate); // 输出:2024-10-10// 4. 增减年份(当前日期加 1 年)LocalDate nextYear = now.plusYears(1);System.out.println("明年今日:" + nextYear); // 示例:2025-09-03}
}

2. LocalDateTime:日期时间(年月日时分秒)

2.1 核心方法
方法声明功能描述
static LocalDateTime now()获取当前日期时间
static LocalDateTime of(int year, int month, int dayOfMonth, int hour, int minute, int second)创建指定年月日时分秒的 LocalDateTime 对象(月份从1开始)
LocalDateTime plusHours(int hours)增加小时,返回新对象
LocalDateTime minusMinutes(int minutes)减少分钟,返回新对象
2.2 代码示例
package com.code.day14;import java.time.LocalDateTime;public class Day14LocalDateTime {public static void main(String[] args) {// 1. 获取当前日期时间LocalDateTime now = LocalDateTime.now();System.out.println("当前日期时间:" + now); // 示例:2024-09-03T15:40:30.123// 2. 创建指定日期时间(2020年10月10日10时10分10秒)LocalDateTime targetTime = LocalDateTime.of(2020, 10, 10, 10, 10, 10);System.out.println("指定日期时间:" + targetTime); // 输出:2020-10-10T10:10:10// 3. 增减时间(加2小时,减30分钟)LocalDateTime modifiedTime = targetTime.plusHours(2).minusMinutes(30);System.out.println("修改后时间:" + modifiedTime); // 输出:2020-10-10T11:40:10}
}

3. Period & Duration:日期/时间差值计算

3.1 Period:计算日期差值(年月日)
  • 核心作用:计算两个 LocalDate 之间的差值,返回年、月、日的具体差值。
  • 常用方法
    • static Period between(LocalDate start, LocalDate end):计算 startend 的日期差(end 需在 start 之后,否则差值为负);
    • int getYears():获取相差的年数;
    • int getMonths():获取相差的月数;
    • int getDays():获取相差的天数。
3.2 Duration:计算时间差值(时分秒毫秒)
  • 核心作用:计算两个 LocalDateTime(或 LocalTime)之间的差值,返回天、时、分、秒、毫秒的具体差值。
  • 常用方法
    • static Duration between(Temporal start, Temporal end):计算 startend 的时间差;
    • long toDays():转换为相差的天数;
    • long toHours():转换为相差的小时数;
    • long toMinutes():转换为相差的分钟数;
    • long toMillis():转换为相差的毫秒数。
3.3 代码示例
package com.code.day14;import java.time.Duration;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.Period;public class Day14PeriodDuration {public static void main(String[] args) {// ------------------- Period:计算日期差 -------------------LocalDate date1 = LocalDate.of(2024, 10, 10);LocalDate date2 = LocalDate.of(2025, 11, 12);Period period = Period.between(date1, date2);System.out.println("日期差:" + period.getYears() + "年" + period.getMonths() + "月" + period.getDays() + "天");// 输出:日期差:1年1月2天// ------------------- Duration:计算时间差 -------------------LocalDateTime time1 = LocalDateTime.of(2020, 1, 1, 0, 0);LocalDateTime time2 = LocalDateTime.of(2022, 1, 1, 1, 1);Duration duration = Duration.between(time1, time2);System.out.println("时间差:" + duration.toDays() + "天 " + (duration.toHours() % 24) + "小时 " + (duration.toMinutes() % 60) + "分钟");// 输出:时间差:731天 1小时 1分钟}
}

4. DateTimeFormatter:日期时间格式化(JDK8+)

  • 核心作用:替代 JDK8 之前的 SimpleDateFormat,线程安全,用于 LocalDate/LocalDateTime 与字符串的相互转换。
  • 常用方法
    • static DateTimeFormatter ofPattern(String pattern):指定格式创建 DateTimeFormatter 对象(格式占位符与 SimpleDateFormat 一致,如 yyyy-MM-dd HH:mm:ss);
    • String format(TemporalAccessor temporal):将日期时间对象(如 LocalDateTime)格式化为字符串;
    • TemporalAccessor parse(CharSequence text):将符合格式的字符串解析为 TemporalAccessor,再通过 LocalDateTime.from() 转为目标对象。
代码示例
package com.code.day14;import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAccessor;public class Day14DateTimeFormatter {public static void main(String[] args) {// 1. 格式化:LocalDateTime → StringLocalDateTime now = LocalDateTime.of(2019, 10, 10, 10, 10, 10);// 指定格式DateTimeFormatter formatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");String timeStr = formatter1.format(now);System.out.println("格式化结果:" + timeStr); // 输出:2019-10-10 10:10:10// 2. 解析:String → LocalDateTimeString targetStr = "2019-10-10 10:10:10";DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");// 先解析为 TemporalAccessor,再转为 LocalDateTimeTemporalAccessor temporal = formatter2.parse(targetStr);LocalDateTime parsedTime = LocalDateTime.from(temporal);System.out.println("解析结果:" + parsedTime); // 输出:2019-10-10T10:10:10// 简化解析方式(直接通过 LocalDateTime.parse() 重载方法)LocalDateTime simplifiedParsed = LocalDateTime.parse(targetStr, formatter2);System.out.println("简化解析结果:" + simplifiedParsed); // 输出:2019-10-10T10:10:10}
}

八、System 类:系统工具类

1. System 类核心特点

  • 概述:与系统交互的工具类,提供系统级别的操作。
  • 核心特点
    • 构造方法私有(无法 new 对象);
    • 所有方法均为静态方法(通过 System.方法名() 调用)。

2. System 类常用方法

方法声明功能描述
static long currentTimeMillis()获取当前系统时间对应的毫秒值(从1970-01-01 00:00:00 UTC开始)
static void exit(int status)退出当前JVM(status=0 表示正常退出,非0表示异常退出)
static void arraycopy(Object src, int srcPos, Object dest, int destPos, int length)数组复制(高效原生方法)

3. 代码示例

package com.code.day14;import java.util.Date;public class Day14System {public static void main(String[] args) {// 1. 获取当前系统时间毫秒值long currentTime = System.currentTimeMillis();System.out.println("当前时间毫秒值:" + currentTime);// 转为 Date 对象查看Date nowDate = new Date(currentTime);System.out.println("当前时间:" + nowDate); // 示例:Tue Sep 03 16:05:23 CST 2024// 2. 数组复制(将 src 数组的内容复制到 dest 数组)int[] src = {1, 2, 3, 4, 5};int[] dest = new int[src.length];// 参数含义:源数组、源数组起始索引、目标数组、目标数组起始索引、复制长度System.arraycopy(src, 0, dest, 0, src.length);System.out.print("复制后的目标数组:");for (int num : dest) {System.out.print(num + " "); // 输出:1 2 3 4 5 }// 3. 退出JVM(注释掉避免影响后续代码执行)// System.exit(0);// System.out.println("此代码不会执行(JVM已退出)");}
}

九、Arrays 类:数组工具类

1. Arrays 类核心作用

  • 概述:专门用于操作数组的工具类,提供排序、查找、复制、打印等常用功能。
  • 核心特点
    • 构造方法私有;
    • 方法均为静态方法。

2. Arrays 类常用方法

方法声明(以 int 数组为例)功能描述
static void sort(int[] a)对数组进行升序排序(快速排序实现,效率高)
static String toString(int[] a)将数组转为字符串(格式:[元素1, 元素2, ...]),方便打印
static int binarySearch(int[] a, int key)二分查找指定元素在数组中的索引(前提:数组已升序排序;未找到返回负数)
static int[] copyOf(int[] original, int newLength)数组复制/扩容:创建新数组,长度为 newLength,内容从原数组复制(长度不足补默认值,如 int 补 0)

3. 代码示例

package com.code.day14;import java.util.Arrays;public class Day14Arrays {public static void main(String[] args) {// 1. 数组打印(toString())int[] arr1 = {1, 2, 3, 4, 5};System.out.println("arr1 原始值:" + Arrays.toString(arr1)); // 输出:[1, 2, 3, 4, 5]// 2. 数组排序(sort())int[] arr2 = {5, 3, 1, 4, 2};Arrays.sort(arr2);System.out.println("arr2 排序后:" + Arrays.toString(arr2)); // 输出:[1, 2, 3, 4, 5]// 3. 二分查找(binarySearch(),需先排序)int[] arr3 = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};int index = Arrays.binarySearch(arr3, 5);System.out.println("元素 5 在 arr3 中的索引:" + index); // 输出:4(索引从0开始)// 查找不存在的元素(返回负数)int noIndex = Arrays.binarySearch(arr3, 11);System.out.println("元素 11 在 arr3 中的索引:" + noIndex); // 输出:-11// 4. 数组扩容(copyOf())int[] arr4 = {1, 2, 3, 4, 5};// 扩容为原长度的2倍(不足部分补0)int[] newArr = Arrays.copyOf(arr4, arr4.length * 2);System.out.println("arr4 扩容后:" + Arrays.toString(newArr)); // 输出:[1, 2, 3, 4, 5, 0, 0, 0, 0, 0]}
}

十、包装类:基本类型与引用类型的桥梁

1. 包装类概述

  • 定义:为 8 种基本类型提供对应的 引用类型(包装类),解决“集合只能存储引用类型”“方法参数需引用类型”等问题。
  • 基本类型与包装类对应关系
基本类型包装类
byteByte
shortShort
intInteger
longLong
floatFloat
doubleDouble
charCharacter
booleanBoolean

2. Integer 类核心使用(以 Integer 为例,其他包装类用法类似)

2.1 构造/创建方式(JDK9+ 推荐)

JDK9 之前的 new Integer(int)new Integer(String) 已过时,推荐使用 静态工厂方法 valueOf()

  • static Integer valueOf(int i):将 int 转为 Integer
  • static Integer valueOf(String s):将字符串格式的整数转为 Integer(字符串需为纯数字,否则抛 NumberFormatException)。
2.2 装箱与拆箱
  • 装箱:基本类型 → 包装类(手动:Integer.valueOf(100);自动:Integer i = 100,编译器自动调用 valueOf());
  • 拆箱:包装类 → 基本类型(手动:i.intValue();自动:int num = i,编译器自动调用 intValue())。
2.3 关键:Integer 缓存机制(笔试题)

Integer.valueOf() 会缓存 -128 ~ 127 范围内的 Integer 对象,避免重复创建,提升性能:

  • 当值在 -128~127 时,多次调用 valueOf() 返回同一个对象(== 比较为 true);
  • 当值超出范围时,每次调用 valueOf() 创建新对象(== 比较为 false)。

3. 代码示例

package com.code.day14;public class Day14Integer {public static void main(String[] args) {// 1. JDK9+ 创建 Integer 对象(valueOf())Integer i1 = Integer.valueOf(100);Integer i2 = Integer.valueOf("100");System.out.println("i1 = " + i1); // 输出:100System.out.println("i2 = " + i2); // 输出:100// 2. 自动装箱与拆箱Integer i3 = 200; // 自动装箱(等价于 Integer.valueOf(200))int num = i3;     // 自动拆箱(等价于 i3.intValue())System.out.println("num = " + (num + 50)); // 输出:250(拆箱后可直接参与运算)// 3. Integer 缓存机制验证Integer a = 100; // 在缓存范围内(-128~127)Integer b = 100;System.out.println("a == b:" + (a == b)); // 输出:true(同一对象)Integer c = 200; // 超出缓存范围Integer d = 200;System.out.println("c == d:" + (c == d)); // 输出:false(不同对象)System.out.println("c.equals(d):" + c.equals(d)); // 输出:true(equals() 比较值)}
}

总结

本文整理的 10 大类 API 是 Java 开发的基础工具,涵盖 数学运算、高精度数值、日期时间、系统操作、数组处理、类型转换 等核心场景。建议重点掌握:

  1. JDK8 新日期类(LocalDate/LocalDateTime/DateTimeFormatter),替代旧的 Date/Calendar
  2. 包装类的自动装箱/拆箱与缓存机制(面试高频);
  3. BigDecimal 的高精度运算(金融、电商等场景必备);
  4. ArraysSystem 类的实用方法(提升开发效率)。

实际开发中,需结合场景选择合适的 API,并注意异常处理(如 BigDecimal 除法、Integer.valueOf(String) 解析),确保代码健壮性。

http://www.dtcms.com/a/366065.html

相关文章:

  • 【Linux基础】Linux系统管理:深入理解Linux运行级别及其应用
  • burpsuite攻防实验室-JWT漏洞
  • 【串口过滤工具】串口调试助手LTSerialTool v3.12.0发布
  • 哈希表-271.存在重复元素-力扣(LeetCode)
  • C++算法专题学习:模拟算法
  • 写C++十年,我现在怎么设计类和模块?(附真实项目结构)
  • 66这才是真正懂C/C++的人,写代码时怎么区分函数指针和指针函数?
  • 技术方案之Mysql部署架构
  • 极空间打造 “超级中枢”,从书签笔记到聊天分享,一键全搞定!
  • 【单片机day02】
  • Swift 解法详解:LeetCode 370《区间加法》
  • C++ 5
  • 硬件基础与c51基础
  • 【Linux】分离线程
  • 如何下载免费的vmware workstation pro 17版本?
  • 小游戏公司接单难?这几点原因与破局思路值得看看
  • Pytorch笔记一之 cpu模型保存、加载与推理
  • AI隐私保护:当大模型遇上“隐身术”——差分隐私+同态加密,让模型“看不见原始数据”
  • LoRA微调分词器 应用模板(75)
  • test命令与参数
  • Python基础(⑧APScheduler任务调度框架)
  • 数据结构从青铜到王者第十九话---Map和Set(2)
  • git之分支
  • 如何创建交换空间
  • 【音视频】视频秒播优化实践
  • 无穿戴动捕如何深度结合AI数据分析,实现精准动作评估?
  • 代码随想录刷题Day48
  • Linux 字符设备驱动框架学习记录(三)
  • 数学建模-非线性规划(NLP)
  • STM32HAL 快速入门(十七):UART 硬件结构 —— 从寄存器到数据收发流程