package test; import java.util.*; /** * Created by ming */ public class Test { public static void main(String[] args) { Set<Long> longSet=new HashSet<>(); longSet.add(1L); longSet.add(2L); List<Long> longList=new ArrayList<>(); lon…
JAVA的list,set,数组之间的转换,主要是使用Apache Jakarta Commons Collections,具体的方法如下:import org.apache.commons.collections.CollectionUtils; String[] strArray = {"aaa", "bbb", "ccc"}; List strList = new ArrayList(); Set strSet = new Ha…
时间格式转换SimpleDateFormat: //定义日期的格式 SimpleDateFormat format =new SimpleDateFormat("yyMMdd"); //将当前时间转换成上述格式 format.format(Calendar.getInstance().getTime()); y 年 M 月 d 日 h 时 在上午或下午 (1~12) H 时 在一天中 (0~23) m 分 s 秒 S 毫秒 E 星期 D 一年中的第几天 F 一月中…