JAVAÅÅÐò»ã×Ü
package com.wepull.jbs.lesson4;
import java.util.Random;
/**
* ÅÅÐò²âÊÔÀà
*
* ÅÅÐòËã·¨µÄ·ÖÀàÈçÏ£º
* 1.²åÈëÅÅÐò£¨Ö±½Ó²åÈëÅÅÐò¡¢ÕÛ°ë²åÈëÅÅÐò¡¢Ï£¶ûÅÅÐò£©£»
* 2.½»»»ÅÅÐò£¨Ã°ÅÝÅÝÅÅÐò¡¢¿ìËÙÅÅÐò£©£»
* 3.Ñ¡ÔñÅÅÐò£¨Ö±½ÓÑ¡ÔñÅÅÐò¡¢¶ÑÅÅÐò£©£»
* 4.¹é²¢ÅÅÐò£»
* 5.»ùÊýÅÅÐò¡£
*
* ¹ØÓÚÅÅÐò·½·¨µÄÑ¡Ôñ£º
* (1)Èôn½ÏС(Èçn≤50)£¬¿É²ÉÓÃÖ±½Ó²åÈë»òÖ±½ÓÑ¡ÔñÅÅÐò¡£
* ¡¡µ±¼Ç¼¹æÄ£½ÏСʱ£¬Ö±½Ó²åÈëÅÅÐò½ÏºÃ£»·ñÔòÒòΪֱ½ÓÑ¡ÔñÒƶ¯µÄ¼Ç¼ÊýÉÙÓÚÖ±½Ó²åÈË£¬Ó¦Ñ¡Ö±½ÓÑ¡ÔñÅÅÐòΪÒË¡£
* (2)ÈôÎļþ³õʼ״̬»ù±¾ÓÐÐò(Ö¸ÕýÐò)£¬ÔòӦѡÓÃÖ±½Ó²åÈË¡¢Ã°ÅÝ»òËæ»úµÄ¿ìËÙÅÅÐòΪÒË£»
* (3)Èôn½Ï´ó£¬ÔòÓ¦²ÉÓÃʱ¼ä¸´ÔÓ¶ÈΪO(nlgn)µÄÅÅÐò·½·¨£º¿ìËÙÅÅÐò¡¢¶ÑÅÅÐò»ò¹é²¢ÅÅÐò¡£
*
*/
public class SortTest {
/**
* ³õʼ»¯²âÊÔÊý×éµÄ·½·¨
* @return Ò»¸ö³õʼ»¯ºÃµÄÊý×é
*/
public int[] createArray() {
Random random = new Random();
int[] array = new int[10];
for (int i = 0; i < 10; i++) {
array[i] = random.nextInt(100) - random.nextInt(100);//Éú³ÉÁ½¸öËæ»úÊýÏà¼õ£¬±£Ö¤Éú³ÉµÄÊýÖÐÓиºÊý
}
System.out.println("==========ÔʼÐòÁÐ==========");
printArray(array);
&nbs
Ïà¹ØÎĵµ£º
Javaѧϰ´ÓÈëÃŵ½¾«Í¨
Ò»¡¢ JDK (Java Development Kit)
JDKÊÇÕû¸öJavaµÄºËÐÄ£¬°üÀ¨ÁËJavaÔËÐл·¾³£¨Java Runtime Envirnment£©£¬Ò»¶ÑJava¹¤¾ßºÍJava»ù´¡µÄÀà¿â(rt.jar)¡£²»ÂÛʲôJavaÓ¦Ó÷þÎñÆ÷ʵÖʶ¼ÊÇÄÚÖÃÁËij¸ö°æ±¾µÄJDK¡£Òò´ËÕÆÎÕJDKÊÇѧºÃJavaµÄµÚÒ»²½¡£×îÖ÷Á÷µÄJ ......
Java NIO APIÏê½â
ÔÚJDK
1.4ÒÔÇ°£¬JavaµÄIO²Ù×÷¼¯ÖÐÔÚjava.ioÕâ¸ö°üÖУ¬ÊÇ»ùÓÚÁ÷µÄ×èÈû£¨blocking£©API¡£¶ÔÓÚ´ó¶àÊýÓ¦ÓÃÀ´Ëµ£¬ÕâÑùµÄAPIʹÓúܷ½
±ã£¬È»¶ø£¬Ò»Ð©¶ÔÐÔÄÜÒªÇó½Ï¸ßµÄÓ¦Óã¬ÓÈÆäÊÇ·þÎñ¶ËÓ¦Óã¬ÍùÍùÐèÒªÒ»¸ö¸üΪÓÐЧµÄ·½Ê½À´´¦ÀíIO¡£´ÓJDK 1.4Æð£¬NIO
API×÷Ϊһ¸ö»ùÓÚ»º³åÇø£¬²¢ÄÜÌṩ·Ç×èÈû(non-blo ......
1, ±£Ö¤Ḭ̈߳²È«µÄÈýÖÖ·½·¨:
a, ²»Òª¿çÏ̷߳ÃÎʹ²Ïí±äÁ¿
b, ʹ¹²Ïí±äÁ¿ÊÇfinalÀàÐ͵Ä
c, ½«¹²Ïí±äÁ¿µÄ²Ù×÷¼ÓÉÏͬ²½
2, Ò»¿ªÊ¼¾Í½«ÀàÉè¼Æ³ÉḬ̈߳²È«µÄ, ±ÈÔÚºóÆÚÖØÐÂÐÞ¸´Ëü,¸üÈÝÒ×.
3, ±àд¶àÏ̳߳ÌÐò, Ê×Ïȱ£Ö¤ËüÊÇÕýÈ·µÄ, Æä´ÎÔÙ¿¼ÂÇÐÔÄÜ.
4, ÎÞ×´Ì ......
javaÖÐËùÓж¼ÊÇunicodeµÄ±àÂ룬¿ÖÅ´ó¼Ò¶¼Çå³þ£¬µ«ÊÇÕâ¾ßÌåÊÇÄÄÀïµÄ±àÂë¡£ÔÚһ̨ÖÐÎÄwindows²Ù×÷ϵͳ£¨GBK£©£¬»òÓ¢ÎĵÄlinux²Ù×÷ϵͳÏ£¨ISO-8859-1£©Ï£¬ÕâЩ±àÂëÊÇÈçºÎת»»µÄ¡£JAVAÖеÄStringÀàµÄgetBytes()·½·¨ºÍStringÀàµÄÖ¸¶¨±àÂ뷽ʽµÄ¹¹Ô캯ÊýÖеıàÂëÓÖÊÇÈçºÎÄØ£¿
ÕâÀïÎÒ²»×öÉîÈë½âÊÍ£¬Ö»ÊÇչʾһÏÂÕâЩ±àÂë ......
1¡¢Oracle8/8i/9iÊý¾Ý¿â£¨thinģʽ£©
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String url="jdbc:oracle:thin:@localhost:1521:orcl";
//orclΪÊý¾Ý¿âµÄSID
String user="test";
String password="test";
Connection conn= DriverManager.getConnection(url,user,password);
2¡¢DB2 ......