摘要:
private static void demo03() { Properties pro1 = new Properties();// 创建properties对象 pro1.setProperty("wf", "guxianling");// 设置内容 pro1.setProperty("my" 阅读全文
摘要:
private static void demo02() { Properties pro = new Properties();//创建properties属性类的对象 File file = new File("D:\\test"+File.separator+"文件名.properties") 阅读全文
摘要:
public class properties { public static void main(String[] args) { Properties properties = new Properties();//创建properties对象 properties.setProperty("M 阅读全文
摘要:
/** * 为集合增加内容。 使用addALL()方法可以为一个集合增加内容,此方法可以接收可变参数,所以可以传递任意多的参数作为集合的内容 */ private static void test02() { List<String> all = new ArrayList<String>(); C 阅读全文
摘要:
/** * 反转集合中的内容 */ private static void test03() { List<String> list = new ArrayList<>(); Collections.addAll(list, "w", "l", "m");//给list集合添加元素 Collecti 阅读全文
摘要:
private static void test04() { List<String> all = new ArrayList<>(); Collections.addAll(all, "q", "f", "z"); int point = Collections.binarySearch(all, 阅读全文
摘要:
private static void test05() { List<String> list = new ArrayList<>(); Collections.addAll(list, "wa", "fe", "zh"); if (Collections.replaceAll(list, "wa 阅读全文
摘要:
/** * 集合排序 * 使用排序这个方法,如果一个自定义的类一定要实现comparable接口,否则会出现类型转换异常,string类本身已经实现好了comparable接口 */ private static void test09() { List<String> list = new Arr 阅读全文
摘要:
private static void test08() { List<String> list = new ArrayList<>(); Collections.addAll(list, "a", "g", "as"); System.out.println("交换之前的集合:"); Iterat 阅读全文