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

浙公网安备 33010602011771号