JAVA»ù±¾±äÁ¿µÄ¼¸µãÈÏʶ
JAVAÖлù±¾±äÁ¿¹²°üÀ¨£ºbyte,short,int,long,float,double,char,boolean,ÔÚ³ÌÐòÖÐÓõÄ×îÆձ飬×î¶à£¬µ«ÊÇËüÃǵÄһЩ¹Ø¼üÒ²¾³£±»ÎÒÃÇËùºöÂÔ£¬ÎÒ½ñÌì×ܽáÁËһϣ¬ÌùÔÚÕâÀï¡£¡£¡£
1.
±äÁ¿¶¨Ò壺
Ò»¸öÓɱêʶ·û¶¨ÒåµÄÊý¾ÝÏ°üÀ¨ÀàÐÍ¡¢Ãû³ÆºÍÖµÈý¸ö²¿·Ö
2.
±äÁ¿·ÖÀࣺ
ÀàÐÍ
´óС
˵Ã÷
byte
1
×Ö½Ú
(8
λ
)
·¶Î§£º
-128~127
£¬³£ÓÃÓÚ×Ö½ÚÊý×飬È罫Êý×Ö´æÈë×Ö½ÚÊý×飨¼ûСÁ·Ï°
2
£©£¬½«×Ö·û´®×ª»»³É×Ö½ÚÊý×é
(
¼û
codeh).
short
2
×Ö½Ú
(16
λ
)
·¶Î§
:-32767~32768
int
4
×Ö½Ú
(32
λ
)
int
ÊÇÕûÐεÄĬÈÏÀàÐÍ£¬¼´ËùÓгõʼ»¯µÄÕûÐζ¼ÊÇ
int
ÐÍ£¬Èç
byte i = 22; byte j = 3; i + j
ºÍ
5
²»ÊÇ
byte
ÐͶøÊÇ
int
ÐÍ
long
8
×Ö½Ú
(64
λ
)
Èç¹û½«Ò»¸öÕûÊý¶¨Òå³É
long
ÐͱØÐëÔÚÊýºó¼Ó
L
»ò
l
£¬Èç
256L
float
4
×Ö½Ú
(32
λ
)
¸¡µãÊýÀàÐÍ£¬Èç¹û½«ÕûÊý»ò¸¡µã¶¨ÒåΪ
float
ÀàÐÍ£¬ÔòÆäºóÒª¼Ó
f
£¬ÒòΪ¸¡µãĬÈÏÀàÐÍÊÇ
double
£¬½«ÕûÐθ³Öµ¸ø
float
ʱ£¬Èç¹ûÕûÐεÄλÊý³¬¹ý
32
ÔòÐè¼Ó
f
£¬·ñÔò²»
f
Ò²¿ÉÒÔ
double
8
×Ö½Ú
(64
λ
)
¸¡µãÊýÀàÐ͵ÄĬÈÏÀàÐÍ£¬µ«
double
ÀàÐͺó¿ÉÒÔ¼Ó
D
Ò²¿É²»¼Ó
char
2
×Ö½Ú
(16
λ
)
ÓÃÓÚ´æ·Å×Ö·û£¬±íʾ
Unicode
±àÂë±íÖеÄ×Ö·û£¬Õ¼Á½¸ö×Ö½Ú£¬ÆäÖÐÓ¢ÎÄ×Ö·ûºÍÊý×ÖÔڴ洢ʱֻռÆäÖеÄÒ»¸ö×Ö½Ú£¬¶øºº×ÖÕ¼Á½¸ö×Ö½Ú£¬
char
¿ÉÒÔºÍ
int
»¥Ïàת»»¡£¿ÉÒÔ¸³ÖµÎª£º
’ ’
µ«ÊDz»¿ÉÒÔÊÇ
’’
£¬¿ÉÒÔÓÃ
ASCII
Âë±êʶ×Ö·û£¬·¶Î§
:01~255
£¬ÔÚÓÃ×Ö·ûÅжϷ¶Î§Ê±³£Óõ½
ASCII
Âë¡£
boolean
1/8
×Ö½Ú
(1
λ
)
ÓÐÁ½¸öÖµ£º
true,false
¿ÉÒÔºÍ
0
¡¢
1
»¥»»£¬ÊÇ
boolean
ÀàÐ͵Ä×îСѰַ¿Õ¼äÊÇ
1byte
£¬¼´Õ¼Óÿռä
1byte
£¬µ«ÊÇÖ»Õ¼ÆäÖеÄ
1
λ¡£
×¢£ºËäÈ»
float
ºÍ
int
λÊýÏàͬ£¬
double
ºÍ
long
µÄλÊýÏàͬ£¬µ«ÊÇ
int
ºÍ
long
¾ùûÓÐ
float
ºÍ
double
±íʾµÄ·¶Î§´ó£¬ÒòΪ
double
ºÍ
float
ÓÐСÊýλ¡£
3
£®Êý¾ÝÀàÐ͵Äת»»
˵Ã÷£º
½ÏСµÄÀàÐÍ¿ÉÒÔÖ±½Ó¸³Öµ¸ø½Ï´óµÄÀàÐÍ£¬Èç
byte i = 8; int j
= i;
½Ï´óµÄÀàÐ͸³Öµ¸ø½ÏСµÄÀàÐÍÐèҪǿÖÆת»»
,
Èç
int m = 256;
byte n = (int)m;
µ«ÊÇ´Ëʱ»áËðʧ¾«¶È£¬ÒòΪ
byte
×î¶à´æ´¢
8
룬µ«ÊÇÈç¹û
m
²»³¬¹ý
8
룬¾Í²
Ïà¹ØÎĵµ£º
1¡¢Oracle8/8i/9iÊý¾Ý¿â£¨thinģʽ£©
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String url="jdbc:oracle:thin:@localhost:1521:orcl"; //orclΪÊý¾Ý¿âµÄSID
String user="test";
String password="test";
Connection conn= DriverManager.getC ......
Ŀ ¼
1 ¼¯ºÏ¿ò¼Ü... 2
1.1 ¼¯ºÏ¿ò¼Ü¸ÅÊö... 2
1.1.1 ÈÝÆ÷¼ò½é... 2
1.1.2 ÈÝÆ÷µÄ·ÖÀà... 4
1.2 Collection. 5
1.2.1  ......
ÏÖÔÚµÄÎÒ°¡£¬»¹ÊǸöѧÉú£¬¸Õ¸ÕѧÁ˵ãVB£¬¶¯×÷×î´óÒ²¾ÍÊÇÓÃVB±àдÁËÒ»¸ö¼ÆËã½×³ËµÄ¹¤¾ß£¬Ëµ³öÀ´ÕæÊÇÈø÷λ¿´¹ÙЦµô´óÑÀ……µ«ÊÇÎÒͻȻÓÐÖÖÏë·¨£¬ÏëѧJava£¬±¾ÈËרҵÊÇͨÐŹ¤³Ì£¬¾õµÃÒƶ¯Í¨ÐÅ»áÓÐÏ൱´óµÄǰ;£¬ÓÚÊÇÃÈÉúÁËÕâ¸öÏë·¨£¡¸÷λ¿´¹Ù±ðЦ»°ÎÒ£¬ÄÜÌá°ÎµÄÌá°Îµã£¬²»ÄÜÌá°ÎµÄ¸øµã¹ÄÀø£¡ÔÚÏÂл¹ý¸÷λÁË£¡ ......
Ç°ÑÔ£ºÇ°¶Îʱ¼äÔÚCSDNµÄC++ÉçÇøÓöµ½Ò»¸öÐèÒª·â×°¿¼ÇÚ»ú½Ó¿ÚµÄ¶¯Ì¬¿â¸øJAVAµ÷ÓõÄÌû×Ó£¬¹´ÆðÁËÎÒ¶ÔJAVAµÄÎÞÏÞ»³Äî¡£ÔÚ´Ë£¬ÎÒÏë°ÑÕâÏî¼¼Êõ¼òµ¥ÔÙ½éÉÜһϡ£
Ò»¡¢¹ØÓÚJava Native Interface (JNI)
JNIÊÇJAVA±¾µØ±à³Ì½Ó¿Ú£¬ÊôÓÚJDKµÄÒ»²¿·Ö¡£ËüÔÊÐíJAVAÄܹ»²Ù×÷±¾µØAPI»òÓÉÆäËûÓïÑÔ±àдµÄ¶¯Ì¬¿â¡£²»¹ýµ±ÄãʹÓÃÕâÏî¼¼ÊõµÄʱºò£ ......