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

¡¶JavaÃæÏò¶ÔÏó±à³Ì¡·—JavaÖеļ¯ºÏ


1.¼¯ºÏµÄÌص㣺
¶¼Î»ÓÚ java.util°üÖУ¬²»ÄÜ´æ·Å»ù±¾ÀàÐ͵ÄÊý¾Ý£¬¶øÖ»ÄÜ´æ·Å¶ÔÏóµÄÒýÓ㬲Ù×÷µÄÊýÄ¿¿ÉÒÔ²»¹Ì¶¨£¨ÀàËÆÓÚ¶¯Ì¬Êý×飩¡£
2.·ÖÀࣺ
ÓÐÈý¸öÀࣺ
a.Set(¼¯)£º¶ÔÏó²»°´Ìض¨·½Ê½ÅÅÐò£¬Ã»ÓÐÖظ´ÔªËØ¡£Õâ¸öÓëÊýѧÖеļ¯ºÏ¸ÅÄî×îÏàËÆ¡£
b.List(Áбí)£º°´ÕÕË÷ÒýλÖÃÅÅÐò£¬¿ÉÒÔÓÐÖظ´ÔªËØ£¬ÔÊÐí°´ÕÕ¶ÔÏóÔÚ¼¯ºÏÖеÄË÷ÒýλÖüìË÷¶ÔÏó¡£
c.Map£¨Ó³É䣩£ºÃ¿Ò»¸öÔªËØ°üº¬Ò»¸ö¼üÖµ¶Ô¡£Ã»ÓÐÖظ´µÄ¼üÖµ¶Ô£¬µ«ÊÇÖµ¶ÔÏó¿ÉÒÔÖظ´¡£
ÓÐÁ½¸ö½Ó¿Ú£º
Collection½Ó¿ÚÊÊÓÃÓÚJava¼¯ºÏÖеÄSetºÍList£¨ÕâÁ½¸öÀàÖ±½Ó¼Ì³ÐÁËÕâ¸ö½Ó¿Ú£©£¬ÌṩÁËһЩͨÓòÙ×ݵľ²Ì¬·½·¨¡£
Iterator½Ó¿ÚÒþ²ØÁ˵ײ㼯ºÏµÄÊý¾Ý½á¹¹£¬¶ÔÍâÌṩÁ˱éÀú¸÷ÖÖÊý¾ÝÀàÐͼ¯ºÏµÄͳһ½Ó¿Ú¡£ÓÉcollection¼¯ºÏµÄiteratorµÃµ½Ò»¸öIterator¡£Óï·¨ÈçÏ£º
Iterator it = set.iterator();
£¨×¢Òâ´ËºóÈôͨ¹ýcollection·½·¨ÐÞ¸ÄÁ˼¯ºÏÔòʹÓÃnext£¨£©·½·¨Ê±»á³öÏÖÒì³££¬ÒòΪÆäÔËÓÃÁËËùν¿ìËÙʧ°Ü»úÖÆ¡£±ÜÃâÁËDZÔڵĹ²Ïí×ÊÔ´¾ºÕù¶øµ¼ÖµIJ¢·¢ÎÊÌ⣩¡£
3.Set¼¯ºÏ£º
Ö÷ÒªÓÐÁ½¸öʵÏÖÀࣺHashSetºÍTreeSet¡£
Ç°ÕßʹÓùþÏ£Ëã·¨£¬´æÈ¡Ëٶȿ죬Ëü»¹ÓÐÒ»¸ö×ÓÀàLinkedHashSetÀ࣬ÐÔÄܸü¸ß¡£HashSetÏò¼¯ºÏÖмÓÈëÒ»¸ö¶ÔÏóʱ£¬»áµ÷ÓöÔÏóµÄhashCode()·½·¨µÃµ½¹þÏ£Â룬Ȼºó¸ù¾ÝÕâ¸ö¹þÏ£Âë¼ÆËã³ö¶ÔÏóÔÚ¼¯ºÏÖеĴæ·ÅλÖá£
ΪÁ˱£Ö¤ÆäÄÜÕý³£¹¤×÷£¬ÒªÇóµ±Á½¸ö¶ÔÏóÓÃequals()·½·¨±È½ÏµÄ½á¹ûΪtrueʱËüÃǵĹþÏ£ÂëÒ²±ØÐëÏàͬ¡£Õâ¾ÍÒªÇóÎÒÃÇÈç¹ûÔÚÎÒÃÇ×Ô¼ºÉè¼ÆµÄÀàÖи²¸ÇÁËequals·½·¨£¬ÄÇôҲҲӦ¸Ã¸²¸ÇhashCode()·½·¨¡£ÓÃequals()·½·¨±È½ÏµÄ½á¹ûΪfalseʱ£¬×îºÃhashCode²»Í¬£¬¼õÉÙ¹þÏ£³åÍ»£¬Ìá¸ßÐÔÄÜ¡£
¶øºóÕßÔòʵÏÖÁËSortedSet½Ó¿Ú£¬¾ßÓÐÅÅÐò¹¦ÄÜ¡£ÓÉÓÚÓû§ÊôÐԱ仯²»»áµ¼ÖÂÖØÐÂÅÅÐò£¬ËùÒÔÊʺϼÓÈë²»¿É±äÀà¡£ÏòÆäÖмÓÈë×Ô¶¨ÒåµÄÀàʱҪעÒ⣬ʵÏÖÆäComparable½Ó¿Ú£¬²¢ÇÒeuqals()µÃ³öµÄ½áÂÛÒªÓëcompareTo()µÃ³öµÄ½áÂÛÏàͬ¡£ÁíÍ⣬Ëü»¹Ö§³ÖComparator½Ó¿Ú£¬¿ÉÒÔ¶¨ÒåÒ»¸öʵÏÖÁ˸ýӿڵÄÀàCustomerComparatorʵÏÖ×Ô¶¨ÒåµÄÅÅÐò¡£ÔÚ¶¨ÒåʱʹÓÃÈçϵÄÓï·¨£º
Set set = new TreeSet(new CustomerComparator);
4.ListÁÐ±í£º
Ö÷ÒªÌØÕ÷ÊÇÒÔÏßÐÔ·½Ê½´æ´¢£¬¼¯ºÏÖпɴæ·ÅÖظ´ÔªËØ¡£
Ö÷ÒªÓÐÁ½¸öʵÏÖÀࣺArrayListºÍLinkedList¡£
Ç°ÕßµÄÌصãÊÇÔÊÐí¶ÔÔªËؽøÐпìËÙËæ»ú·ÃÎÊ£¬µ«²åÓÚºÍɾ³ýÔªËصÄËٶȽÏÂý¡£Ò»°ãÓÃÓÚ´ú±í¿É±äÊý×é¡£
ºóÕßµÄÌصãÊDzÉÓÃÁ´±íÊý¾Ý½á¹¹£¬¶Ô˳Ðò·ÃÎʺÍɾ³ý¡¢²åÈëÔªËØËٶȽϿ죬µ«Ëæ»ú·ÃÎÊËٶȽÏÂý¡£Ò»°ãÓÃÓÚ´ú±


Ïà¹ØÎĵµ£º

ÕýÔò±í´ïʽÔÚphp£¬java£¬javascriptÖзֱðÓ¦ÓÃ

ÔÚjavascriptÖÐÓ÷¨¾ÙÀý
var rule = /^\d+$/;
if(!rule.test(addform.rmb_price.value)) {
alert('rmb_price must be number');
addform.rmb_price.focus();
return false;
}
ÔÚphpÖÐÓ÷¨¾ÙÀý
$aa = "/^\d+$/";
if(preg_match($aa, "111")) {
echo "found";
}
ÔÚjavaÖÐÓ÷¨¾ÙÀý ......

Îı¾¾ÛÀàËã·¨JavaʵÏÖ

ÍÜÍÜÍƼö£ºÍÜÍܽÌÄãÎı¾¾ÛÀà
ÕªÒª£ºÎı¾¾ÛÀàÊÇËÑË÷ÒýÇæºÍÓïÒåwebµÄ»ù±¾¼¼Êõ£¬Õâ´Î±¾Íܺʹó¼ÒÒ»Æðѧϰһϼòµ¥µÄÎı¾¾ÛÀàËã·¨£¬¿ÉÄܲ»ÄÜÖ±½ÓÓÃÓÚʵ¼ÊÓ¦ÓÃÖУ¬µ«¶ÔÓÚÏëѧËÑË÷¼¼ÊõµÄ³õѧÕß»¹ÊÇÓÐÒ»¶¨ÈëÃÅ×÷Óõġ£ÕâÀï»áÓõ½TF/IDFȨÖØ£¬ÓÃÓàÏҼнǼÆËãÎı¾ÏàËƶȣ¬Ó÷½²î¼ÆËãÁ½¸öÊý¾Ý¼äŷʽ¾àÀ룬ÓÃk-means½øÐÐÊý¾Ý¾ÛÀàµÈÊýѧ ......

JavaÈÕÆÚ´¦Àíº¯Êý

/*
* ´´½¨ÈÕÆÚ 2007-03-14
*
* ¹¦ÄÜ   È¡ÈÕÆÚʱ¼ä¹¤¾ß
*
*/
package com.util;

import java
.text.ParseException;
import java
.text.SimpleDateFormat;
import java
.util.Date;
import java
.util.Calendar;
import java
.util.GregorianCalendar;

/**
* ˵Ã÷:   &nbs ......

Java³ÌÐòÔ±Ó¦¸Ã¸ã¶®µÄÁù¸öÎÊÌâ

¶ÔÓÚÕâ¸öϵÁÐÀïµÄÎÊÌ⣬ÿ¸öѧJavaµÄÈ˶¼Ó¦¸Ã¸ã¶®¡£µ±È»£¬Èç¹ûÖ»ÊÇѧJavaÍæÍæ¾ÍÎÞËùνÁË¡£Èç¹ûÄãÈÏΪ×Ô¼ºÒѾ­³¬Ô½³õѧÕßÁË£¬È´²»ºÜ¶®ÕâЩÎÊÌ⣬Ç뽫Äã×Ô¼ºÖعé³õѧÕßÐÐÁС£ÄÚÈݾùÀ´×ÔÓÚCSDNµÄ¾­µäÀÏÌù¡£
¡¡¡¡ÎÊÌâÒ»£ºÎÒÉùÃ÷ÁËʲô£¡
String s = "Hello world!";
¡¡¡¡Ðí¶àÈ˶¼×ö¹ýÕâÑùµÄÊÂÇ飬µ«ÊÇ£¬ÎÒÃǵ½µ×Éù ......

cokie¼¼ÊõÔÚJava MEƽ̨µÄÓ¦ÓÃÓëʵÏÖ

CookieÔÚWebÓ¦ÓóÌÐòÖб»¹ã·º²ÉÓã¬Î¬»¤ä¯ÀÀÆ÷ºÍ·þÎñÆ÷Ö®¼äµÄ״̬¡£Òź¶µÄÊÇÕâÒ»ÌØÐÔÔÚJava
MEƽ̨Öв¢Ã»Óеõ½Ö§³Ö¡£Òò´Ë£¬ÒªÏëά³Ö¿Í»§¶ËºÍ·þÎñÆ÷¶ËµÄ״̬Ôò±ØÐëʹÓÃURLÖØдµÄ·½Ê½¡£URLÖØд²Ù×÷ÆðÀ´±È½ÏÂé·³£¬ËùÒÔÑо¿Ò»ÏÂcookieµÄ
Ô­Àí²¢ÔÚJava MEƽ̨ÉÏʵÏÖcookieÊDz»´íµÄ³¢ÊÔ¡£
Ê×ÏÈ£¬ÎÒÃÇÀ´¿´Ò»ÏÂcookieµÄÔ­Àí¡£µ± ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ