JavaÖеÄ×Ö·û´®Êó±êºÍ¼üÅÌʼþ
×Ö·û´®
1¡¢»ñÈ¡×Ö·û´®µÄ³¤¶È
length()
2 ¡¢ÅжÏ×Ö·û´®µÄǰ׺»òºó׺ÓëÒÑÖª×Ö·û´®ÊÇ·ñÏàͬ
ǰ׺ startsWith(String s)
ºó׺ endsWith(String s)
3¡¢±È½ÏÁ½¸ö×Ö·û´®
equals(String s)
4¡¢°Ñ×Ö·û´®×ª»¯ÎªÏàÓ¦µÄÊýÖµ
intÐÍ Integer.parseInt(×Ö·û´®)
longÐÍ Long.parseLong(×Ö·û´®)
floatÐÍ Folat.valueOf(×Ö·û´®).floatValue()
doubleÐÍ Double.valueOf(×Ö·û´®).doubleValue()
4¡¢½«Êýֵת»¯Îª×Ö·û´®
valueOf(ÊýÖµ)
5¡¢×Ö·û´®¼ìË÷
indexOf(Srting s) ´ÓÍ·¿ªÊ¼¼ìË÷
indexOf(String s ,int startpoint) ´Óstartpoint´¦¿ªÊ¼¼ìË÷
Èç¹ûûÓмìË÷µ½£¬½«·µ»Ø-1
6¡¢µÃµ½×Ö·û´®µÄ×Ó×Ö·û´®
substring(int startpoint) ´Óstartpoint´¦¿ªÊ¼»ñÈ¡
substring(int start,int end) ´Óstartµ½endÖмäµÄ×Ö·û
7¡¢Ìæ»»×Ö·û´®ÖеÄ×Ö·û,È¥µô×Ö·û´®Ç°ºó¿Õ¸ñ
replace(char old,char new) ÓÃnewÌæ»»old
trim()
8¡¢·ÖÎö×Ö·û´®
StringTokenizer(String s) ¹¹ÔìÒ»¸ö·ÖÎöÆ÷£¬Ê¹ÓÃĬÈÏ·Ö¸ô×Ö·û£¨¿Õ¸ñ£¬»»ÐУ¬»Ø³µ£¬Tab£¬½øÖ½·û£©
StringTokenizer(String s,String delim) delimÊÇ×Ô¼º¶¨ÒåµÄ·Ö¸ô·û
nextToken() Öð¸ö»ñÈ¡×Ö·û´®ÖеÄÓïÑÔ·ûºÅ
boolean hasMoreTokens() Ö»Òª×Ö·û´®»¹ÓÐÓïÑÔ·ûºÅ½«·µ»Øtrue£¬·ñÔò·µ»Øfalse
countTokens() µÃµ½Ò»¹²ÓжàÉÙ¸öÓïÑÔ·ûºÅ
JavaÖеÄÊó±êºÍ¼üÅÌʼþ
1¡¢Ê¹ÓÃMouseListener½è¿Ú´¦ÀíÊó±êʼþ
Êó±êʼþÓÐ5ÖÖ£º°´ÏÂÊó±ê¼ü£¬ÊÍ·ÅÊó±ê¼ü£¬µã»÷Êó±ê¼ü£¬Êó±ê½øÈëºÍÊó±êÍ˳ö
Êó±êʼþÀàÐÍÊÇMouseEvent£¬Ö÷Òª·½·¨ÓУº
getX(),getY() »ñÈ¡Êó±êλÖÃ
getModifiers() »ñÈ¡Êó±ê×ó¼ü»òÕßÓÒ¼ü
getClickCount() »ñÈ¡Êó±ê±»µã»÷µÄ´ÎÊý
getSource() »ñÈ¡Êó±ê·¢ÉúµÄʼþÔ´
ʼþÔ´»ñµÃ¼àÊÓÆ÷µÄ·½·¨ÊÇaddMouseListener()£¬ÒÆÈ¥¼àÊÓÆ÷µÄ·½·¨ÊÇremoveMouseListener()
´¦ÀíʼþÔ´·¢ÉúµÄʱ¼äµÄʼþµÄ½Ó¿ÚÊÇMouseListener ½Ó¿ÚÖÐÓÐÈçϵķ½·¨
mousePressed(MouseEvent) ¸ºÔð´¦ÀíÊó±ê°´ÏÂʼþ
mouseReleased(MouseEvent) ¸ºÔð´¦ÀíÊó±êÊÍ·Åʼþ
mouseEntered(MouseEvent) ¸ºÔð´¦ÀíÊó±ê½øÈëÈÝÆ÷ʼþ
mouseExited(MouseEvent)
Ïà¹ØÎĵµ£º
JavaÉè¼Æģʽ֮Singletonµ¥Àýģʽƪ
java µ¥ÀýģʽµÄʵÏÖ·½Ê½
ʵÏÖ1£º
public class Singleton {
private static Singleton instance;
private Singleton (){ //Ê×ÏÈÓÐÒ»¸ö˽ÓеĹ¹ÔìÆ÷
}
  ......
1.»ù±¾¸ÅÄîµÄÀí½â
¾ø¶Ô·¾¶£º¾ø¶Ô·¾¶¾ÍÊÇÄãµÄÖ÷Ò³ÉϵÄÎļþ»òĿ¼ÔÚÓ²ÅÌÉÏÕæÕýµÄ·¾¶£¬(URLºÍÎïÀí·¾¶)ÀýÈ磺 C:\xyz\test.txt ´ú±íÁËtest.txtÎļþµÄ¾ø¶Ô·¾¶¡£http://www.sun.com/index.htmÒ²´ú±íÁËÒ»¸ö URL¾ø¶Ô·¾¶¡£
Ïà¶Ô·¾¶£ºÏà¶ÔÓëij¸ö»ù׼Ŀ¼µÄ·¾¶¡£°üº¬WebµÄÏà¶Ô·¾¶(HTMLÖеÄÏà¶ÔĿ¼)£¬ÀýÈ磺ÔÚ ServletÖУ ......
java´úÂëÓÅ»¯±à³Ì
1.JVM ¹ÜÀíÁ½ÖÖÀàÐ͵ÄÄÚ´æ:¶ÑÄÚ´æ(heap),Õ»ÄÚ´æ(stack),¶ÑÄÚÔÚÖ÷ÒªÓÃÀ´´æ´¢³ÌÐòÔÚÔËÐÐʱ´´½¨»òʵÀý»¯µÄ¶ÔÏóÓë±äÁ¿.¶øÕ»ÄÚ´æÔòÊÇÓÃÀ´´æ´¢³ÌÐò´úÂëÖÐÉùÃ÷Ϊ¾²Ì¬(static)(»ò·Ç¾²Ì¬)µÄ·½·¨.
2.JVM ÖжÔÏóµÄÉúÃüÖÜÆÚ,´´½¨½×¶Î,Ó¦Óý׶Î,²»¿ÉÊӽ׶Î,²»¿Éµ½´ï½×¶Î,¿ÉÊÕ¼¯½×¶Î,ÖÕ½á½×
¶Î,ÊͷŽ׶Î
3.±ÜÃâÔÚÑ ......
ÏÈÌùÒ»¶Î
Java
»ù±¾½á¹¹
Java
½á¹¹°üÀ¨Ëĸö²»Í¬¶øÓÖÏà¹ØµÄ²¿·Ö£º
Java
ÓïÑÔ¡¢
class
Îļþ¸ñʽ¡¢Ó¦ÓóÌÐò½Ó
¿Ú¡¢ÐéÄâ»ú
ÆäÖУ¬ÐéÄâ»úµÄÖ÷ÒªÈÎÎñÊÇÔÚ³ÌÐòÔËÐÐÖÐÐèÒªµÄʱºòµ÷ÓÃ
class
Îļþ²¢Ö´ÐÐÆäÖеÄ×Ö½ÚÂë¡£Ò»¸ö
Java
Ó¦
ÓÃÓÐÁ½ÖÖ
class loader
£º
the system class loader
ºÍ
class loader objects
......
import java.util.*;
import java.util.regex.Pattern;
public class StrTools {
/**
* ·Ö¸î×Ö·û´®
*
* @param str String Ôʼ×Ö·û´®
* @param splitsign String ·Ö¸ô·û
* @return String[] ·Ö¸îºóµÄ×Ö·û´®Êý×é
*/
@SuppressWarnings("unchecked")
public static String[] split(Stri ......