01 2017 档案

摘要:public class DOM4JReader { public static void main(String[] args) throws DocumentException { //读取文件的位置 File file=new File("D:"+File.separator+"ou.xml" 阅读全文
posted @ 2017-01-13 01:41 耳朵像图图 阅读(272) 评论(0) 推荐(0)
摘要:首先要导入jdom的jar包 //写xml public class WriteXML { public static void main(String[] args) throws FileNotFoundException, IOException { Element addressList=n 阅读全文
posted @ 2017-01-13 01:40 耳朵像图图 阅读(254) 评论(0) 推荐(0)
摘要:代码如下: public class Demo2 { public static void main(String[] args) throws ClassNotFoundException, SQLException { //加载驱动 Class.forName("com.mysql.jdbc.D 阅读全文
posted @ 2017-01-09 00:11 耳朵像图图 阅读(9177) 评论(0) 推荐(0)
摘要:public class SingletonDemo5 implements Serializable{ private static SingletonDemo5 instance; //防止单例被反射 private SingletonDemo5(){ if(null!=instance){ t 阅读全文
posted @ 2017-01-05 14:11 耳朵像图图 阅读(513) 评论(0) 推荐(0)
摘要:/** * 测试单例模式:恶汉式 * 有点:线程安全,效率低,类一加载的时候就new对象 * @author codeMan * */public class SingletonDemo1 { private static SingletonDemo1 instance=new SingletonD 阅读全文
posted @ 2017-01-05 12:30 耳朵像图图 阅读(291) 评论(0) 推荐(0)