java集合Set操作
package Sets;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;
/**
* java集合操作
*
* @author baby69yy2000
*
*/
public class Sets {
/** 求并集 */
public static <T> Set<T> union(Set<T> setA, Set<T> setB) {
Set<T> setUnion;
if (setA instanceof TreeSet)
setUnion = new TreeSet<T>();
else
setUnion = new HashSet<T>();
Iterator<T> iterA = setA.iterator();
while (iterA.hasNext())
setUnion.add(iterA.next());
Iterator<T> iterB = setB.iterator();
while (iterB.hasNext())
setUnion.add(iterB.next());
return setUnion;
&n
相关文档:
一、new
使用java的关键字new来创建对象实例。构造函数链中的所有构造函数都会被自动调用。
Java代码:
CreateInstance instance = new CreateInstance ();
二、clone
构造函数不被自动调用。
Java代码:
......
1、语法:必须比较熟悉,在写代码的时候IDE的编辑器对某一行报错应该能够根据报错信息知道是什么样的语法错误并且知道任何修正。
2、命令:必须熟悉JDK带的一些常用命令及其常用选项,命令至少需要熟悉:appletviewer、 HtmlConverter、jar、 java、javac、javadoc、javap、javaw、native2ascii ......
package cn.com.view.read;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;
import jxl.read.biff.BiffException;
public class ReadExcel {
......
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
public class CipherTest {
public static void main(String[] args) {
try {
byte[] keydata = { (byte) 0x00, (byte) 0x01, (byte) 0x02,
(byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06,
......