摘要:
1,静态导入import static java.lang.Math.*;//静态导入的是静态方法和静态类,或者是静态成员变量class StaticImport { public static void main(String[] args) { int a=Math.max(10,20); int b=Math.min(10,20); System.out.println(a); System.out.println(b); }} 2,装箱和拆箱//装箱和拆箱//值类型转换为引用类型---装箱//引用类型转换为值类型---拆箱class BoxAndUnBox { pub... 阅读全文
摘要:
package anby.com;import java.util.Iterator;public class Dom4JRead { public static void main(String[] args) throws DocumentException { //Dom4JReader(); SAXReader saxreader=new SAXReader(); Document doc=saxreader.read("Book.xml"); Node node =doc.selectSingleNode("//book[@id='boo1 阅读全文
摘要:
package anby.com;import java.io.File;import java.io.FileWriter;import java.io.IOException;import org.dom4j.Attribute;import org.dom4j.Document;import org.dom4j.DocumentException;import org.dom4j.DocumentHelper;import org.dom4j.Element;import org.dom4j.Node;import org.dom4j.io.SAXReader;import org.do 阅读全文
摘要:
public static DataTable InitDgvProcessWorker() { ArrayList list=new ArrayList(); DataTable dt = new DataTable(); string str= "select WorkerNO as 工号,[Name] as 姓名,DutyContent as 职 责,[Group] as 组名... 阅读全文
摘要:
package anby.com;import java.io.File;import java.io.IOException;import javax.xml.parsers.DocumentBuilder;import javax.xml.parsers.DocumentBuilderFactory;import javax.xml.parsers.ParserConfigurationException;import javax.xml.transform.Source;import javax.xml.transform.Transformer;import javax.xml.tra 阅读全文
摘要:
package anby.com;import java.io.File;import java.io.IOException;import java.util.ArrayList;import java.util.List;import javax.xml.parsers.DocumentBuilder;import javax.xml.parsers.DocumentBuilderFactory;import javax.xml.parsers.ParserConfigurationException;import org.w3c.dom.Document;import org.w3c.d 阅读全文
摘要:
import java.io.FileInputStream;import java.io.FileOutputStream;import java.io.ObjectInputStream;import java.io.ObjectOutputStream;import java.io.Serializable;import java.util.Properties;public class Properties序列化和反序列化{ /** * @param args */ public static void main(String[] args) { try { Perso... 阅读全文
摘要:
// SendMessage.java - Sample application.//// This application shows you the basic procedure for sending messages.// You will find how to send synchronous and asynchronous messages.//// For asynchronous dispatch, the example application sets a callback// notification, to see what's happened with 阅读全文
摘要:
View Code public class FactoryMethod{ /** * @param args */ public static void main(String[] args) { Factory.condition(2).operation("Hello"); }}class Factory{ public static Api condition(int n) { if (n == 1) { return new ImpA(); } ... 阅读全文
摘要:
多线程import java.io.IOException;import java.util.Set;public class ProcessBuilderDemo{ public static void main(String[] args) { final Person p=new Person(); Thread thread=new Thread() { boolean flag=false; public void run() { ... 阅读全文