JAVA³£ÓÃÀàµÄʹÓ÷½·¨
JAVA³£ÓÃÀàµÄʹÓ÷½·¨
£±¡¢IntegerÀà
£²¡¢FloatÀà
£³¡¢DoubleÀà
£´¡¢CharacterÀà
£µ¡¢StringÀà
£¶¡¢StringTokenizerÀà
£·¡¢StringBufferÀà
£¸¡¢RandomÀà
1£®IntegerÀàµÄʹÓ÷½·¨
Interger£ºÕûÊýÀàÐÍ
£±¡¢ÊôÐÔ¡£
static int MAX_VALUE£º·µ»Ø×î´óµÄÕûÐÍÊý£»
static int MIN_VALUE£º·µ»Ø×îСµÄÕûÐÍÊý£»
static Class TYPE £º·µ»Øµ±Ç°ÀàÐÍ¡£
Àý×Ó£º
System.out.println("Integer.MAX_VALUE: " + Integer.MAX_VALUE );
½á¹ûΪ£ºInteger.MAX_VALUE: 2147483647
£²¡¢¹¹Ô캯Êý¡£
Integer(int value) £ºÍ¨¹ýÒ»¸öintµÄÀàÐ͹¹Ôì¶ÔÏó£»
Integer(String s) £ºÍ¨¹ýÒ»¸öStringµÄÀàÐ͹¹Ôì¶ÔÏó£»
Àý×Ó£º
Integer i = new Integer("1234");
Éú³ÉÁËÒ»¸öֵΪ1234µÄInteger¶ÔÏó¡£
£³¡¢·½·¨¡£
˵Ã÷£º
1. ËùÓз½·¨¾ùΪpublic£»
2. Êéд¸ñʽ£º£ÛÐÞÊηû£Ý¡¡<·µ»ØÀàÐÍ> <·½·¨Ãû£¨£Û²ÎÊýÁбí£Ý£©>
È磺
static int parseInt(String s) ±íʾ£º´Ë·½·¨£¨parseInt£©ÎªÀà·½·¨£¨static£©£¬·µ»ØÀàÐÍΪ£¨int£©£¬·½·¨ËùÐè²ÎÊýΪStringÀàÐÍ¡£
1. byteValue()£ºÈ¡µÃÓÃbyteÀàÐͱíʾµÄÕûÊý£»
2. int compareTo(Integer anotherInteger) £º±È½ÏÁ½¸öÕûÊý¡£ÏàµÈʱ·µ»Ø£°£»Ð¡ÓÚʱ·µ»Ø¸ºÊý£»´óÓÚʱ·µ»ØÕýÊý¡£
Àý×Ó£º
Integer i = new Integer(1234);
System.out.println("i.compareTo: " + i.compareTo(new Integer(123)) );
½á¹ûΪ£ºi.compareTo: 1
3. int compareTo(Object o) £º½«¸ÃÕûÊýÓëÆäËûÀà½øÐбȽϡ£Èç¹ûoҲΪIntegerÀ࣬½øÐз½·¨2 µÄ²Ù×÷£»·ñÔò£¬Å׳öClassCastExceptionÒì³£¡£
4. static Integer decode(String nm) £º½«×Ö·û´®×ª»»ÎªÕûÊý¡£
5. double doubleValue() £ºÈ¡µÃ¸ÃÕûÊýµÄË«¾«¶È±íʾ¡£
6. boolean equals(Object obj) £º±È½ÏÁ½¸ö¶ÔÏó¡£
7. float floatValue() £ºÈ¡µÃ¸ÃÕûÊýµÄ¸¡µãÊý±íʾ¡£
8. static Integer getInteger(String nm) £º¸ù¾ÝÖ¸¶¨ÃûÈ·¶¨ÏµÍ³ÌØÕ÷Öµ¡£
9. static Integer getInteger(String nm, int val) £ºÉÏÃæµÄÖØÔØ¡£
10. static Integer getInteger(String nm, Integer val) £ºÉÏÃæµÄÖØÔØ¡£
11. int hashCode() £º·µ»Ø¸ÃÕûÊýÀàÐ͵ĹþÏ£±íÂë¡£
12. int intValue() £º ·µ»Ø¸ÃÕûÐÍÊýËù±íʾµÄÕûÊý¡£
13. long longValue() £º·µ»Ø¸ÃÕûÐÍÊýËù±íʾµÄ³¤ÕûÊý¡£
14. static int parseInt(String s) £º½«×Ö·û´®×ª»»³ÉÕûÊý¡£s±ØÐëÊÇʱ½øÖÆÊý×é³É£¬·ñÔòÅ׳öNumberFormatExceptionÒì³£¡£
15. static int parseInt(S
Ïà¹ØÎĵµ£º
2009-04-14 15:37
ËäÈ»ÏÖÔÚÓÃAPACHE COMMONS DBCP¿ÉÒԷdz£·½±ãµÄ½¨Á¢Êý¾Ý¿âÁ¬½Ó³Ø£¬
µ«ÊÇÏñÕâƪÎÄÕ°ÑÊý¾Ý¿âÁ¬½Ó³ØµÄÄÚ²¿ÔÀíдµÄÕâô͸³¹£¬×¢ÊÓÕâôÍêÕû£¬
ÕæÊǷdz£Äѵã¬Èÿª·¢ÈËÔ±¿ÉÒÔ¸üÉî²ã´ÎµÄÀí½âÊý¾Ý¿âÁ¬½Ó³Ø£¬ÕæÊǷdz£¸Ð
лÕâƪÎÄÕµÄ×÷Õß¡£
import java.sql.Connection;
import java.sql.DatabaseMetaData;
......
ÎÒÔÚÍæÒ»¸öÍøÒ³ÓÎÏ·µÄʱºò×ÜÊÇ°´Ò»¸ö¼ü¡£¾õ×ÅÀÛ¡£ËùÒÔ¾ÍдÁËÒ»¸ö³ÌÐò¡£
Robot r = new Robot();
// °´¼ü
r.keyPress(51);
// ÊÍ·Å
r.keyRelease(51);
ÓÃRobot Õâ¸öʵÏÖ×Ô¶¯»¯µÄÀà¾Í¿É×öµ½¡£ÊµÏÖÕâ¸öÓÎÏ·Ò»Ö±°´ÏÂÕâ¸ö¼ü×Ó¡£
Ò²¿ÉÒÔ×ö°´¼ü¾«ÁéÀàËƵÄÈí¼þ¡£µ«ÊÇÕâ¸öÀàÖ»ÄÜÓ¦Óõ±Ç°´°¿Ú¡£ÔõôÄÜ°ÑÕâ¸ö³ÌÐò¹Ì¶¨ÔÚij ......
/**
* °ÑÖ¸¶¨µÄÄÚÈÝдµ½Ö¸¶¨Â·¾¶µÄÎı¾ÎļþÉÏ
*
* @param pathÖ¸¶¨Â·¾¶
* @param context ҪдµÄÄÚÈÝ
*/
public static void writeFile(String path, String context) {
// ´Ó¿ØÖÆ̨ÊäÈëÄÚÈÝдÈëÎļþ
try {
FileWriter fw = new FileWriter(path, true);
PrintWriter pw = new Print ......
¹¤ÓûÉÆÆäÊ£¬±ØÏÈÀûÆäÆ÷¡£ÊìϤ¿ª·¢»·¾³¿ÉÒÔÈÃÄã¸ü¿ì¸üºÃ¸üÊæ·þµØ¿ª·¢Èí¼þ¡£¾ÍÈçͬVC/.net¿ª·¢ÈËÔ±Àë²»¿ªmsdn£¬java¿ª·¢ÈËÔ±ÍùÍùÒ²Àë²»¿ªjava API¡£ÏÂÃæ½éÉÜÏÂÈçºÎÔÚEclipseºÍNetBeansÖе¼Èëjava API¡£Ê¹Ö®¿ÉÒÔ·½±ã¿ìËٵزéÕÒ£¬¶¨Î»¡£
¡¡¡¡±¾ÎÄÊʺÏÓë¸Õ¸Õ½Ó´¥Eclipse»òNetBeansµÄjava¿ª·¢ÈËÔ±£¬»òÕßÊÇÓоÑéµÄʹÓÃEc ......
1. Java Ô´ÎļþÖÐ×î¶àÖ»ÄÜÓÐÒ»¸öpublicÀà,¶øÇÒÕâ¸öÀàµÄÀàÃûÒªºÍÎļþÃûÒ»ÖÂ.ÆäËûÀàµÄ¸öÊý²»ÏÞ¡£
2. ÃæÏò¶ÔÏó³ÌÐòÉè¼ÆµÄÌØÕ÷£¨·â×°ÐÔ£©£¨¼Ì³Ð£©£¨¶à̬ÐÔ£©
3. ½Ó¿ÚÊÇÓÉ£¨³éÏó·½·¨£©ºÍ£¨³£Á¿£©×é³ÉµÄÌØÊâÀà
4. ÓÃstaticÐÞÊεķ½·¨Ê ......