java ´úÂëÓÅ»¯
1.1 ²»ÓÃnew¹Ø¼ü´Ê´´½¨ÀàµÄʵÀý
ÓÃnew¹Ø¼ü´Ê´´½¨ÀàµÄʵÀýʱ£¬¹¹Ô캯ÊýÁ´ÖеÄËùÓй¹Ô캯Êý¶¼»á±»×Ô¶¯µ÷Óᣵ«Èç¹ûÒ»¸ö¶ÔÏóʵÏÖÁËCloneable½Ó¿Ú£¬ÎÒÃÇ¿ÉÒÔµ÷ÓÃËüµÄclone()·½·¨¡£clone()·½·¨²»»áµ÷ÓÃÈκÎÀ๹Ô캯Êý¡£
ÔÚʹÓÃÉè¼Æģʽ£¨Design Pattern£©µÄ³¡ºÏ£¬Èç¹ûÓÃFactoryģʽ´´½¨¶ÔÏó£¬Ôò¸ÄÓÃclone()·½·¨´´½¨ÐµĶÔÏóʵÀý·Ç³£¼òµ¥¡£ÀýÈ磬ÏÂÃæÊÇFactoryģʽµÄÒ»¸öµäÐÍʵÏÖ£º
public static Credit getNewCredit() {
return new Credit();
}
¸Ä½øºóµÄ´úÂëʹÓÃclone()·½·¨£¬ÈçÏÂËùʾ£º
private static Credit BaseCredit = new Credit();
public static Credit getNewCredit() {
return (Credit) BaseCredit.clone();
}
ÉÏÃæµÄ˼·¶ÔÓÚÊý×é´¦ÀíͬÑùºÜÓÐÓá£
1.2 ʹÓ÷Ç×èÈûI/O
°æ ±¾½ÏµÍµÄJDK²»Ö§³Ö·Ç×èÈûI/O API¡£Îª±ÜÃâI/O×èÈû£¬Ò»Ð©Ó¦ÓòÉÓÃÁË´´½¨´óÁ¿Ï̵߳İ취£¨ÔڽϺõÄÇé¿öÏ£¬»áʹÓÃÒ»¸ö»º³å³Ø£©¡£ÕâÖÖ¼¼Êõ¿ÉÒÔÔÚÐí¶à±ØÐëÖ§³Ö²¢·¢I/OÁ÷µÄÓ¦ÓÃÖмû µ½£¬ÈçWeb·þÎñÆ÷¡¢±¨¼ÛºÍÅÄÂôÓ¦Óõȡ£È»¶ø£¬´´½¨JavaÏß³ÌÐèÒªÏ൱¿É¹ÛµÄ¿ªÏú¡£
JDK 1.4ÒýÈëÁË·Ç×èÈûµÄI/O¿â£¨java.nio£©¡£Èç¹ûÓ¦ÓÃÒªÇóʹÓð汾½ÏÔçµÄJDK£¬ÔÚÕâÀïÓÐÒ»¸öÖ§³Ö·Ç×èÈûI/OµÄÈí¼þ°ü¡£
Çë²Î¼ûSunÖйúÍøÕ¾µÄ¡¶µ÷ÕûJavaµÄI/OÐÔÄÜ¡·¡£
1.3 É÷ÓÃÒì³£
Òì ³£¶ÔÐÔÄܲ»Àû¡£Å׳öÒì³£Ê×ÏÈÒª´´½¨Ò»¸öеĶÔÏó¡£Throwable½Ó¿ÚµÄ¹¹Ô캯Êýµ÷ÓÃÃûΪfillInStackTrace()µÄ±¾µØ£¨Native£© ·½·¨£¬fillInStackTrace()·½·¨¼ì²é¶ÑÕ»£¬ÊÕ¼¯µ÷Óøú×ÙÐÅÏ¢¡£Ö»ÒªÓÐÒì³£±»Å׳ö£¬VM¾Í±ØÐëµ÷Õûµ÷ÓöÑÕ»£¬ÒòΪÔÚ´¦Àí¹ý³ÌÖд´½¨ÁËÒ»¸öРµÄ¶ÔÏó¡£
Òì³£Ö»ÄÜÓÃÓÚ´íÎó´¦Àí£¬²»Ó¦¸ÃÓÃÀ´¿ØÖƳÌÐòÁ÷³Ì¡£
1.4 ²»ÒªÖظ´³õʼ»¯±äÁ¿
ĬÈÏÇé¿ö Ï£¬µ÷ÓÃÀàµÄ¹¹Ô캯Êýʱ£¬ Java»á°Ñ±äÁ¿³õʼ»¯³ÉÈ·¶¨µÄÖµ£ºËùÓеĶÔÏó±»ÉèÖóÉnull£¬ÕûÊý±äÁ¿£¨byte¡¢short¡¢int¡¢long£©ÉèÖóÉ0£¬floatºÍ double±äÁ¿ÉèÖóÉ0.0£¬Âß¼ÖµÉèÖóÉfalse¡£µ±Ò»¸öÀà´ÓÁíÒ»¸öÀàÅÉÉúʱ£¬ÕâÒ»µãÓÈÆäÓ¦¸Ã×¢Ò⣬ÒòΪÓÃnew¹Ø¼ü´Ê´´½¨Ò»¸ö¶ÔÏóʱ£¬¹¹Ô캯ÊýÁ´ ÖеÄËùÓй¹Ô캯Êý¶¼»á±»×Ô¶¯µ÷Óá£
1.5 ¾¡Á¿Ö¸¶¨ÀàµÄfinalÐÞÊηû
JAVAÊÖ»úÍø[www.cnjm.net]
´øÓÐfinalÐÞÊηûµÄÀàÊDz»¿ÉÅÉÉúµÄ¡£ÔÚJavaºËÐÄAPIÖУ¬ÓÐÐí¶àÓ¦ÓÃfinalµÄÀý×Ó£¬ÀýÈçjava.lang.String¡£ÎªStringÀàÖ¸¶¨final·ÀÖ¹ÁËÈËÃǸ²¸Çlength()·½·¨¡£
ÁíÍ⣬Èç¹ûÖ¸¶¨Ò»¸öÀàΪfinal£¬Ôò¸ÃÀàËùÓеķ½·¨¶¼ÊÇfinal¡£Java±àÒëÆ÷»áÑ°ÕÒ»ú»áÄÚÁª£¨inline£©ËùÓеÄfinal·½·¨£
Ïà¹ØÎĵµ£º
JAVA\JSPÉÏ´«×é¼þ
±¾ÈËÖ»ÓÐÕâ¸öË®×¼,»áµÄÇëÖ¸µã£¬²»»áµÄ£¬¿ÉÒÔÄÃÔ´Âë
´ó¸ÅµÄÒªÇó£º
µ¥¶À¸ºÔðÉÏ´«µÄÀà,Ö»ÓÃiframeµ÷ÓÃÆäËüµÄÀ಻Óõ÷ÓÃ
ÉÏ´«Ô¤ÀÀ
µ¥¸öÎļþÉÏ´«Óë¶à¸öÎļþ¶¼Ö§¸¶
¶à¸öÎļþÉÏ´«ÐèÒªÔÚiframe¸¸¼¶Ò³Ãæ´«²Î£¬Ò²¾ÍÊÇ¿ª¹ØÄñ
Ô¤ÀÀʱ¿ÉÒÔɾ³ýÔÎļþºÍÔ¤ÀÀµÄ(¶à¸öÎļþ)ij¸ö½Úµã
ÎļþÀàÐ͵ÄÔÚiframe¶¨Òå
½ûÖ¹ÓÃ ......
JAVAѧϰµÄһЩÖصã
1. JavaÓïÑÔ»ù´¡
̸µ½JavaÓïÑÔ»ù´¡Ñ§Ï°µÄÊé¼®£¬´ó¼Ò¿Ï¶¨»áÍƼöBruce EckelµÄ¡¶Thinking in Java¡·¡£ËüÊÇÒ»±¾Ð´µÄÏ൱Éî¿ÌµÄ¼¼ÊõÊé¼®£¬JavaÓïÑÔ»ù´¡²¿·Ö»ù±¾Ã»ÓÐÆäËüÈκÎÒ»±¾Êé¿ÉÒÔ³¬Ô½Ëü¡£¸ÃÊéµÄ×÷ÕßBruce EckelÔÚÍøÂçÉϱ»³ÆΪÌì²ÅµÄͶ»úÕߣ¬×÷Õߵġ¶Thinking in C++¡·ÔÚ1995ÄêÔø»ñSoftwareDev ......
¶þ ¶ÔÏó
ÀàʵÀý»¯¿ÉÉú³É¶ÔÏ󣬶ÔÏóͨ¹ýÏûÏ¢´«µÝÀ´½øÐн»»¥¡£ÏûÏ¢´«µÝ¼´¼¤»îÖ¸¶¨µÄij¸ö¶ÔÏóµÄ·½·¨ÒԸıäÆä״̬»òÈÃËü²úÉúÒ»¶¨µÄÐÐΪ¡£Ò»¸ö¶ÔÏóµÄÉúÃüÖÜÆÚ°üÀ¨Èý¸ö½×¶Î£ºÉú³É¡¢Ê¹ÓúÍÏû³ý¡£
¶ÔÏóµÄÇå³ý
¡¡¡¡ µ±²»´æÔÚ¶ÔÒ»¸ö¶ÔÏóµÄÒýÓÃʱ£¬¸Ã¶ÔÏó³ÉΪһ¸öÎÞÓöÔÏó¡£JavaµÄÀ¬»ø ......
oracle
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String url="jdbc:oracle:thin:@localhost:1521:orcl";
String user="scott";
String password="tiger";
Connection conn= DriverManager.getConnection(url,user,password);
Statement stmt=conn.createStatement(ResultSet.TYPE_S ......
/**********Customer .java begin***********/
import java.util.HashSet;
import java.util.Set;
/**
* Èç¹ûÁ½¸öCustomer¶ÔÏónamaÊôÐÔºÍageÊôÐÔÏàͬ£¬ÄÇôÕâÁ½¸öCustomer¶ÔÏóÏàµÈ¡£
* @author Administrator
*
*/
public class Customer {
private String nam ......