Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Java³ÌÐò£¬Ò»¸öʵÏÖEnumerationµÄ×éºÏÀà

import java.util.Enumeration;
public class CipherTest implements Enumeration {
private int N;
private int c[], k;
private Object[] objs;
public CipherTest(Object[] items) {
N = items.length;
c = new int[N + 1];
for (int i = 0; i <= N; i++)
c[i] = i;
objs = items;
k = 1;
}
public boolean hasMoreElements() {
return (k < N);
}
public Object nextElement() {
int i = 0;
if ((k & 1) != 0)
i = c[k];
Object tmp = objs[k];
objs[k] = objs[i];
objs[i] = tmp;
k = 1;
while (c[k] == 0)
c[k] = k++;
c[k]--;
return objs;
}
public static void main(String[] args) {
// String[] strs = { "1", "2", "3", "4" };
Integer[] nums = new Integer[6];
for (int i = 0; i < nums.length; i++)
nums[i] = i + 1;
System.out.println("N=" + nums.length);
Enumeration e = new CipherTest(nums);
int count = 0;
while (e.hasMoreElements()) {
Object[] a = (Object[]) e.nextElement();
if (((Integer) a[0]).intValue() != 4)
continue;
boolean isContinue = false;
for (int i = 0; i < a.length - 1; i++) {
if ((((Integer) a[i]).intValue() == 2 && ((Integer) a[i + 1])
.intValue() == 3)
|| (((Integer) a[i]).intValue() == 3 && ((Integer) a[i + 1])
.intValue() == 2)) {
isContinue = true;
break;
}
}
if (isContinue)
continue;
System.out.print("{" + a[0]);
for (int i = 1; i < a.length; i++)
System.out.print(", " + a[i]);
System.out.println("}");
count++;
}
System.out.println("count=" + count);
}
}


Ïà¹ØÎĵµ£º

java»ù´¡ÈëÃÅѧϰ±Ê¼Ç(Ò»):bubblesortËã·¨¸öÈËѧϰ


public class bubblesort {
 public static void main(String[] args) {
 
   int array[]=new int[]{1,5,9,4,6,2};   
   
   int m;
  
   for(int i=0;i<array.length;i++){
    System.out.print(arra ......

JAVA JNI

http://blog.csdn.net/hbcui1984/archive/2009/12/10/4980805.aspx
Ò»¡¢¸ÅÊö
JNI(java native interface)£¬JAVA±¾µØ½Ó¿Úµ÷Óã¬Ä¿µÄÊÇΪÁËJAVA¿ÉÒÔµ÷Óñ¾µØ³ÌÐò£¬Ö÷ÒªÓŵãÓУº
Ìá¸ßЧÂÊ£¬½â¾öÐÔÄÜÎÊÌâ
·ÀÖ¹·´±àÒ룬Ìá¸ßºËÐÄ´úÂ밲ȫÐÔ
ÔöÇ¿±¾»ú½Ó¿Úµ÷ÓÃ
ǶÈëʽ¿ª·¢Ó¦ÓÃ
    ÈçÏÂͨ¹ýÒ»¸ö×î¼òµ¥µÄÐ ......

JavaÀûÓÃxml½«´óÅúÁ¿Êý¾Ýµ¼³öµ½excelµÄÒ»¸ö·½·¨

±ÊÕßÔÚJava¿ª·¢Öг£³£»áÓöµ½½«Êý¾Ý¿âÊý¾Ýµ¼³öµ½ExcelµÄÒªÇ󣬱ÈÈçÔÚÎÒµÄÒ»¸öÏîÄ¿ÖУ¬¿Í»§ÒªÇóËùÓвéѯ½á¹û¶¼¿ÉÒÔµ¼³öµ½Excel£¬¶ÔÓÚÊý¾ÝÁ¿²»´óµÄ£¨¼¸ÍòÌõ£©£¬Õâ±È½ÏÈÝÒ×ʵÏÖ£¬µ«¶ÔÓÚÊý¾ÝÁ¿±È½Ï´óµÄ£¨¼¸Ê®Íò¼°ÒÔÉÏ£¬¾ßÌåÒª¿´µ¼³öÄÚÈݵÄ×ֶθöÊýºÍ³¤¶Ì£©£¬ÔòÔÚÊý¾Ý¿â²éѯºÍÉú³ÉexcelÎļþÉ϶¼»áÓÐÂé·³¡£
ÒÔÎÒÔÚʵ¼ÊÏîÄ¿ÖеÄÒ»¸ ......

java¶ÁÈ¡±¾µØexcelÎļþ´úÂë

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 { ......

ÉîÈëÁ˽âJava ClassLoader¡¢Bytecode ¡¢ASM¡¢cglib

Ò»¡¢Java ClassLoader
1£¬Ê²Ã´ÊÇClassLoader
Óë C »ò C++ ±àдµÄ³ÌÐò²»Í¬£¬Java ³ÌÐò²¢²»ÊÇÒ»¸ö¿ÉÖ´ÐÐÎļþ£¬¶øÊÇÓÉÐí¶à¶ÀÁ¢µÄÀàÎļþ×é³É£¬Ã¿Ò»¸öÎļþ¶ÔÓ¦ÓÚÒ»¸ö Java Àà¡£
´ËÍ⣬ÕâЩÀàÎļþ²¢·ÇÁ¢¼´È«²¿¶¼×°ÈëÄڴ棬¶øÊǸù¾Ý³ÌÐòÐèҪװÈëÄÚ´æ¡£ClassLoader ÊÇ JVM Öн«Àà×°ÈëÄÚ´æµÄÄDz¿·Ö¡£
¶øÇÒ£¬Java ClassLoader ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ