随笔分类 -  Java常用类

一些平时最常见的Java类
摘要:7.Math类 常用方法 public class Common07 { //Math类 public static void main(String[] args) { /** *Math.sqrt()//计算平方根 *Math.cbrt()//计算立方根 *Math.pow(a, b)//计算a 阅读全文
posted @ 2022-07-06 17:03 风雨2 阅读(35) 评论(0) 推荐(0)
摘要:5.SimpleDateFormat类 简单的一些运用 public class Common05 { //SimpleDateFormat类 public static void main(String[] args) { Date date = new Date(); SimpleDateFor 阅读全文
posted @ 2022-07-06 17:02 风雨2 阅读(46) 评论(0) 推荐(0)
摘要:3.File类 1.基本属性 public boolean canRead() public boolean exists() public boolean isFile() public long lastModified() public String getName() public bool 阅读全文
posted @ 2022-07-06 17:00 风雨2 阅读(58) 评论(0) 推荐(0)
摘要:2.StringBuilder和StringBuffer 1.insert方法 StringBuilder stringBuilder = new StringBuilder(); //insert方法 System.out.println(" insert方法 "); stringBuilder. 阅读全文
posted @ 2022-07-05 09:01 风雨2 阅读(43) 评论(0) 推荐(0)
摘要:1.String类 1.基本操作 String name = "zhj123zhj";//定义一个name System.out.println("获取字符串长度"); System.out.println(name.length());//获取字符串长度 System.out.println("指 阅读全文
posted @ 2022-07-04 11:05 风雨2 阅读(117) 评论(0) 推荐(0)