Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

¹ØÓÚ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¡


Ïà¹ØÎĵµ£º

java µ÷ÓÃÃüÁî ±¸·ÝmysqlÊý¾Ý¿â

 ´úÂëÈçÏ£º
  1  String command  =   " cmd /c C:/Program Files/MySQL/MySQL Server 5.0/bin>mysqldump -h localhost -u root -p aijia > E:/aijia.dmp " ;
  2      try    {
  3     Process process& ......

Java Logger(javaÈÕÖ¾)


Ŀ¼
1. ¼ò½é
2. °²×°
3. log4j»ù±¾¸ÅÄî
3.1. Logger
3.2. Appender
3.2.1. ʹÓÃConsoleAppender
3.2.2. ʹÓÃFileAppender
3.2.3. ʹÓÃWriterAppender
3.3. Layout
3.4. »ù±¾Ê¾Àý
3.4.1. SimpleLayoutºÍFileAppender
3.4.2. HTMLLayoutºÍWriterAppender
3.4.3. PatternLayoutºÍConsoleAppender
4. ʹÓÃÍⲿ ......

javaʱ¼ä¶¯Ì¬ÏÔʾ Á½ÖÖ·½·¨

ʱ¼ä¶¯Ì¬ÏÔʾ
1.·½·¨Ò» ÓÃTimerTask
ÀûÓÃjava.util.TimerºÍjava.util.TimerTaskÀ´×ö¶¯Ì¬¸üУ¬±Ï¾¹Ã¿´Î¸üпÉÒÔ¿´×÷ÊǼÆʱ1Ãë·¢ÉúÒ»´Î¡£
´úÂëÈçÏ£º
import java.awt.Dimension;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Timer;
import java.util ......

Jconsole ºÍ jps ÎÞ·¨ÏÔʾ±¾µØ Java ½ø³ÌÁбí

Ç°Ò»ÕóÔÚ¹«Ë¾ÀïʹÓà jconsle ʱһÇÐÕý³££¬È»¶øÔÚ¼ÒÖеĻúÆ÷ÉÏÈ´³öÏÖÁ˱êÌâËùʾµÄÎÊÌ⣺
jconsole ºÍ jps ÎÞ·¨ÏÔʾ±¾µØ Java ½ø³ÌÁÐ±í¡£
µ±Ê±Ö±½ÓÀûÓà -Dcom.sun.management.jmxremote.port=port Æô¶¯Ä¿±ê java ½ø³Ì£¬²¢ÔÚ jconsole ÖÐͨ¹ý localhost:port ·½Ê½³É¹¦Á¬½ÓÉÏÄ¿±ê java ½ø³Ì¡£ÓÐÁËÕâ¸ö work around Ö®ºó£¬¶ÔÕ ......

Serializable javaÐòÁл¯

Bean Serializable Interface µÄ½Ó¿ÚÈÃBEAN¿ÉÒÔ´®Ðл¯£¬½«Æä±ä³ÉÒ»¸ö¿É±£´æΪÒÔºóʹÓõĶþ½øÖÆÁ÷¡£µ±Ò»¸öBEAN±»ÏµÁл¯µ½´ÅÅÌÉÏ»òÕßÆäËûÈκεط½£¬Æä״̬±»±£´æÆðÀ´£¬ÆäÖеÄÊôÐÔÖµÒ²²»»á¸Ä±ä¡£ÔÚBEANµÄ¹æ·¶ÖУ¬JSP²¢Ã»ÓÐÒªÇóBEANʵÏÖSerializable½Ó¿Ú¡£µ«ÊÇ£¬Èç¹ûÄúÏ£Íû×Ô¼º¿ØÖÆÄúËù´´½¨µÄ×é¼þµÄserialization½ø³Ì£¬»òÕßÄúÏë ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ