¹ØÓÚjavaÖбäÁ¿µÄ³õʼ»¯µÄÎÊÌâ
Ê×ÏÈһЩ±»³õʼ»¯¶ÔÏóµÄ¸ÅÄ
Àà±äÁ¿£¨Àྲ̬³ÉÔ±£©£º Àà±»¼ÓÔØʱ²úÉú£»ËüµÄÉú´æÆÚÊÇÀàµÄÉú´æÆÚ£»×Ô¶¯³õʼ»¯£¨Àà±»¼ÓÔØ£©
³ÉÔ±±äÁ¿£¨Àà³ÉÔ±£©£º ÔÚʹÓÃnew´´½¨¸ÃÀàʵÀýʱ²úÉú£»ËüµÄÉú´æÆÚÓë¸ÃÀàʵÀý¶ÔÏóµÄÉú´æÆÚÏàͬ£»
×Ô¶¯³õʼ»¯£¨¹¹Ôì·½·¨±»µ÷Óã©
¾Ö²¿±äÁ¿£¨ÀàµÄ·½·¨ÖеıäÁ¿£©£º ¸Ã·½·¨±»µ÷ÓÃʱ²úÉú£» Ôڸ÷½·¨Í˳öºó½áÊø£» ±ØÐëÏÔʽ³õʼ»¯
1 ·½·¨ÖеıäÁ¿£¬²»»á±»×Ô¶¯³õʼ»¯¡£±ÈÈçmain·½·¨ÖеıäÁ¿index£¬¶¨ÒåÈçint index; Ëü²»»á±»×Ô¶¯³õʼ»¯¡£
2 µ±ÓÃnew¶¨ÒåһЩ±äÁ¿£¬»á×Ô¶¯³õʼ»¯£¬Èç int [] d = new int[100]; Ëü×Ô¶¯³õʼ»¯Îª0¡£
¸÷Êý¾ÝÀàÐ͵ÄÊý×é×Ô¶¯³õʼֵÈçÏ£º
byte 0
short 0
int 0
long 0l
float 0.0f
double 0.0d
char \u0000 ¼´ÊýÖµ0£¬¶ø·Ç×Ö·û0£¬ÒòΪËüÊÇ0~~65535µÄÐòÁС£×Ö·û0λ
ÖÃÔÚ48ÉÏ£¬¼´\u0030
boolean false
reference null ÈçString
3 Àà³ÉÔ±Èç¹ûûÓỶ¨Òå»á×Ô¶¯»ñÈ¡Ò»¸ö³õʼֵ¡£Ê×ÏÈÔËÐÐÉùÃ÷µÄÀà³ÉÔ±£¬Èç¹ûÓж¨Ò壬ÔòÈ¡¶¨ÒåÖµ£¬Ëæºóµ÷Óù¹Ô캯Êý£¬Èç¹û¹¹Ô캯ÊýÖжÔÒѶ¨Òå±äÁ¿Öظ³Öµ£¬ÔòÈ¡Öظ³µÄÖµ¡£
4 StackÀàÐÍ×Ô¶¯³õʼ»¯Îª¿Õ¡£¿ÕÏÔʾΪ[]£¬¶ø²»ÊÇnull¡£
¾ÙÀý£º
class Test
{
static int myArg ;
public static void main(String[] args)
{
int myArg; //Èç¹û´ËÒÆÐÐûÓÐд£¬¼´¿Éͨ¹ý±àÒëÁË¡£
System.out.pringln(myArg);
}
}
ͨ²»¹ý±àÒë¡£
5¡¡Êý×鶨Òå
¿ÉÒÔÈç϶¨Òå
int iArray[] = null;
6 ¾²Ì¬¿éºÍÀà³ÉÔ±¶¨ÒåµÄÓÅÏȼ¶
//ÈÔÄ£ºý£¬¾²Ì¬¿é£¬»ò´úÂë¿éʲôʱºòµ÷Óã¬ÊÇÔÚÀàÉú³É³õô£¿ÄÇÓ¦¸ÃÒª±È³ÉÔ±±äÁ¿ÒªÔ磬Òò´Ë£¬Ê×ÏÈint i = 10;Æä´Î i = 20£»
ÈçÏ£º
public class Test
{
int i = 20;
static
{
int i = 10;
}
public static void main(String [] args)
{
Test a = new Test();
System.out.println(a.i);
}
}
ÔËÐнá¹û£º20 ÆäÖÐstaticÖеÄiÊôÓÚ´úÂë¿é¡£
7 ¹ØÓÚ¾Ö²¿±äÁ¿ºÍÀà³ÉÔ±Ö®¼äµÄ¹Øϵ: Èç¹û¾Ö²¿±äÁ¿ºÍÀà³ÉԱͬÃû£¬ÄÇô¸Ã·½·¨ÖÐÈϾֲ¿±äÁ¿¡£
8 BooleanÊÇÒýÓÃÀàÐͺÍStringÀàËÆ°É£¬³õʼֵΪnull£»¶øbooleanÊÇ»ù±¾ÀàÐÍ£¬³õʼֵΪfalse¡
Ïà¹ØÎĵµ£º
/*
±¾¶Î´úÂëÔÚ¹«Ë¾ÏîÄ¿ÖÐʵ¼ÊÔ¶³Ìµ÷ÓõÚÈý·½¹«Ë¾ÌṩµÄC#¿ª·¢WebServiceµÄʾÀý
*/
/**
* µÇ¼ÓÎÏ·
*
* @param paramPN
* @param paramTerraceID
* @param paramSvrID
*/
private String loginGame(String paramPN, HttpServletRequest req){
&n ......
×î½üÓöµ½Ò»¸öÐèÇóÒªÔÚlinuxÏÂÓÃjava µ÷ÓÃmysql¿Í»§¶ËÔ¶³ÌµÇ½mysql·þÎñÆ÷£¬´Ó¿Í»§¶Ë»úÆ÷µ¼Èëmysql½Å±¾£¬´Ómysql·þÎñÆ÷¶Ëµ¼³ö±íÖеÄÊý¾Ý¡£ÒÔÏÂÊÇÓõ½µÄÖ÷Òª·½·¨£º
Java ´úÂë
/**
* µ¼ÈëÊý¾Ý
* @param ½Å±¾µÄµØÖ·ºÍÃû³Æ
* @return ÊÇ·ñ³ ......
ÕâÊÇÒ»¸öÓÃJAVA W3C DOM ½øÐÐXML²Ù×÷µÄÀý×Ó£¬°üº¬Á˲éѯ¡¢Ôö¼Ó¡¢Ð޸ġ¢É¾³ý¡¢±£´æµÄ»ù±¾²Ù×÷¡£½ÏÍêÕûµÄÃèÊöÁËÒ»¸öXMLµÄÕû¸ö²Ù×÷Á÷³Ì¡£ÊʺϸÕÈëÃÅJAVA XML²Ù×÷µÄÅóÓѲο¼ºÍѧϰ¡£
¼ÙÉèÓÐXMLÎļþ£ºtest1.xml
<?xml version="1.0" encoding="UTF-8"?>
<books>
<book>
< ......
Ç°Ò»ÕóÔÚ¹«Ë¾ÀïʹÓà jconsle ʱһÇÐÕý³££¬È»¶øÔÚ¼ÒÖеĻúÆ÷ÉÏÈ´³öÏÖÁ˱êÌâËùʾµÄÎÊÌ⣺
jconsole ºÍ jps ÎÞ·¨ÏÔʾ±¾µØ Java ½ø³ÌÁÐ±í¡£
µ±Ê±Ö±½ÓÀûÓà -Dcom.sun.management.jmxremote.port=port Æô¶¯Ä¿±ê java ½ø³Ì£¬²¢ÔÚ jconsole ÖÐͨ¹ý localhost:port ·½Ê½³É¹¦Á¬½ÓÉÏÄ¿±ê java ½ø³Ì¡£ÓÐÁËÕâ¸ö work around Ö®ºó£¬¶ÔÕ ......
Ò»¡¢Ê²Ã´ÊÇJavaÐéÄâ»ú
µ±Äã̸µ½JavaÐéÄâ»úʱ£¬Äã¿ÉÄÜÊÇÖ¸£º
1¡¢³éÏóµÄJavaÐéÄâ»ú¹æ·¶
2¡¢Ò»¸ö¾ßÌåµÄJavaÐéÄâ»úʵÏÖ
3¡¢Ò»¸öÔËÐеÄJavaÐéÄâ»úʵÀý
¶þ¡¢JavaÐéÄâ»úµÄÉúÃüÖÜÆÚ
Ò»¸öÔËÐÐ ......