java³£ÓÃÀàµÄʹÓ÷½·¨
java³£ÓÃÀàµÄʹÓ÷½·¨
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(String s, int radix) £ºÒÔradixΪ»ùÊýradix·µ»ØsµÄÊ®½øÖÆÊý¡£ËùνµÄ»ùÊý£¬¾ÍÊÇ“¼¸½øÖÆ”¡£
Ïà¹ØÎĵµ£º
1Ê×ÏÈÌí¼ÓÐÞ¸ÄͼƬ¿í¶ÈºÍ¸ß¶ÈµÄ·½·¨
public static void reduceImg(String imgsrc, int widthdist, int heightdist) {
try {
File srcfile = new File(imgsrc);
if (!srcfile.exists()) {
return;
}
......
JDBC¶ÁÈ¡Êý¾Ý¿âÔªÊý¾Ý,Éú³ÉJAVAʵÌåÀà
package com.nffish.util;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import com.nffish.c ......
ͨ¹ýjava.awt.RobotµÄcreateScreenCapture½ØÆÁ¡£
public static void captureScreen(String fileName) throws Exception {
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Rectangle screenRectangle = new Rectangle(screenSize);
& ......
JAVA·´Éä»úÖÆ
¸ÅÊö
¡¡¡¡ÓÐʱºòÎÒÃÇ˵ij¸öÓïÑÔ¾ßÓкÜÇ¿µÄ¶¯Ì¬ÐÔ£¬ÓÐʱºòÎÒÃÇ»áÇø·Ö¶¯Ì¬ºÍ¾²Ì¬µÄ²»Í¬¼¼ÊõÓë×÷·¨¡£ÎÒÃÇÀÊÀÊÉÏ¿Ú¶¯Ì¬°ó¶¨£¨dynamic binding£©¡¢¶¯Ì¬Á´½Ó£¨dynamic linking£©¡¢¶¯Ì¬¼ÓÔØ£¨dynamic loading£©µÈ¡£È»¶ø“¶¯Ì¬”Ò»´ÊÆäʵûÓоø¶Ô¶øÆÕ±éÊÊÓõÄÑϸñ¶¨Ò壬ÓÐʱºòÉõÖÁÏñ¶ÔÏóµ¼Ïòµ±³õ±»µ¼Èë±à³ ......
ÔÚʵÏÖsingletonģʽʱ£¬ÎÒÃÇÓÐÒÔϼ¸ÖÖ·½·¨¡£ 1. public static final ×ֶμÓÉÏprivate µÄ¹¹Ô캯Êý¡£ public class Singleton{
public static final Singleton INSTANCE = new Singleton();
......