java¸÷ÖÖÅÅÐò·½·¨
package org.rut.util.algorithm.support;
import org.rut.util.algorithm.SortUtil;
/**
* @author treeroot
* @since 2006-2-2
* @version 1.0
*/
public class InsertSort implements SortUtil.Sort{
/* (non-Javadoc)
* @see org.rut.util.algorithm.SortUtil.Sort#sort(int[])
*/
public void sort(int[] data) {
int temp;
for(int i=1;i<data.length;i++){
for(int j=i;(j>0)&&(data[j]<data[j-1]);j--){
SortUtil.swap(data,j,j-1);
}
}
}
}
ðÅÝÅÅÐò:
package org.rut.util.algorithm.support;
import org.rut.util.algorithm.SortUtil;
/**
* @author treeroot
* @since 2006-2-2
* @version 1.0
*/
public class BubbleSort implements SortUtil.Sort{
/* (non-Javadoc)
* @see org.rut.util.algorithm.SortUtil.Sort#sort(int[])
*/
public void sort(int[] data) {
int temp;
for(int i=0;i<data.length;i++){
for(int j=data.length-1;j>i;j--){
if(data[j]<data[j-1]){
SortUtil.swap(data,j,j-1);
&
Ïà¹ØÎĵµ£º
package com.flxx.docUrl;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.List;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.input.SAXBuilder;
import org.jdom.output.Format;
import org.jd ......
public class Test {
public static void main(String args[]) {
System.out.println(Integer.toBinaryString(20)); //Ê®½øÖÆ-->2½øÖÆ
System ......
ÔÚ¿ª·¢ÏîÄ¿¹¤³Ìʱ£¬¾³£»áÓöµ½±£´æijЩֵ·Åµ½ÏµÍ³µÄcacheÖУ¬ÏÖÓÃCache.javaºÍCacheManager.javaÀ´¹ÜÀí¡£¾ßÌå´úÂë·Ö±ðÈçÏ£º
public class Cache {
private String key;
private Object value;
&n ......
javaÖÐ×Ö·û´®×ª»»³Éʱ¼ä¸ñʽ×ܽá
¹Ø¼ü×Ö: java ×Ö·û´® ʱ¼ä ¸ñʽ
ͨ¹ý³¤Ê±¼äµÄ¶Ôʱ¼ä²»Í¬¸ñʽµÄת»»£¬×Ô¼º¾õµÃÆäʵ¾ÍÊǶԺÁÃëÊýµÄ²Ù×÷
Java´úÂë
System.currentTimeMillis()
System.currentTimeMillis()
µÃµ½´Ó1970Äê1ÔÂ1ÈÕµ½ÏÖÔڵĺÁÃëÊý£¬¾Í¿ÉÒÔת»»³É¸÷ÖÖµÄÐÎʽ¡£
ÓÐÕâÑùÒ»¸ö×Ö·û´®£º“ ......
±äÁ¿,³£Á¿µÄ¸ÅÄî
•
JavaÓïÑÔÖÐÓÐÎåÖÖ²»Í¬ÀàÐ͵ij£Á¿,
–
•1ÕûÐͳ£Á¿:ÈκÎÒ»¸öÕûÐÍÊý×Ö¾ÍÊÇÒ»¸öÕûÐͳ£Á¿.
–JavaÓïÑÔÖÐ,ÕûÐͳ£Á¿ÓÐÈýÖÖ±íʾ·½Ê½:
•Ê®½øÖÆ:0,1,2,3,4,5,6,7,8,9,10,11,12…¶¼ÊÇÊ®½øÖƵij£Á¿
•°Ë½øÖÆ:°Ë½øÖÆ¿ÍÁ÷Á¿Ö»ÄÜÓÃ0,1,2,3,4,5,6,7À ......