![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
基础知识
ChasingSunny
通信程序员的自学之旅
展开
-
Java Collection操作方法
Collection操作方法 库:java.util 基础操作方法 Collection<String> coll = new ArrayList<>(); public boolean add(E e): 把给定的对象添加到当前集合中 。 coll.add("CSDN"); //返回值为布尔值,添加成功均为true public void clear() :清空集合中所有的元素。 coll.clear(); public boolean remove(E e): 把给定原创 2021-04-11 17:27:53 · 123 阅读 · 2 评论 -
Java 基本类型与字符串之间的相互转化
基本类型与字符串之间的相互转化 基本类型 ->字符串 基本数据类型的值+"" 使用包装类中的静态方法 Static String toString(int i) ; 使用String类中的静态方法 Static String Valueof(int i); //方法1 String a = 100+""; //方法2 String b = Integer.toString(100); //方法3 String c = String.valueOf(100); 字符串 -> 基本类型原创 2021-04-11 15:18:30 · 69 阅读 · 0 评论