Java ÄÚ²¿Àà
¶¨ÒåÔÚÒ»¸öÀàÄÚ²¿µÄÀà½ÐÄÚ²¿À࣬°üº¬ÄÚ²¿ÀàµÄÀà³ÆΪÍⲿÀà¡£
ÄÚ²¿Àà¿ÉÒÔÉùÃ÷public¡¢protected¡¢privateµÈ·ÃÎÊÏÞÖÆ£¬
¿ÉÒÔÉùÃ÷ΪabstractµÄ¹©ÆäËûÄÚ²¿Àà»òÍⲿÀà¼Ì³ÐÓëÀ©Õ¹£¬
»òÕßÉùÃ÷Ϊstatic¡¢finalµÄ£¬Ò²¿ÉÒÔʵÏÖÌض¨µÄ½Ó¿Ú¡£
staticµÄÄÚ²¿ÀàÐÐΪÉÏÏóÒ»¸ö¶ÀÁ¢µÄÀ࣬
·ÇstaticÔÚÐÐΪÉÏÀàËÆÀàµÄÊôÐÔ»ò·½·¨ÇÒ½ûÖ¹ÉùÃ÷staticµÄ·½·¨¡£
ÄÚ²¿Àà¿ÉÒÔ·ÃÎÊÍⲿÀàµÄËùÓз½·¨ÓëÊôÐÔ£¬
µ«staticµÄÄÚ²¿ÀàÖ»ÄÜ·ÃÎÊÍⲿÀàµÄ¾²Ì¬ÊôÐÔÓë·½·¨¡£
JavaµÄÉè¼ÆÕßÔÚÄÚ²¿ÀàÉíÉϵÄÈ·ÊÇרÐÄÁ¼¿à¡£Ñ§»áʹÓÃÄÚ²¿À࣬ÊÇ°ÑÎÕJava¸ß¼¶±à³ÌµÄÒ»²¿·Ö£¬Ëü¿ÉÒÔÈÃÄã¸üÓÅÑŵØÉè¼ÆÄãµÄ³ÌÐò½á¹¹¡£
ΪʲôÐèÒªÄÚ²¿Àࣿ
javaÖеÄÄÚ²¿ÀàºÍ½Ó¿Ú¼ÓÔÚÒ»Æ𣬿ÉÒÔʵÏÖ¶à¼Ì³Ð¡£
¿ÉÒÔʹijЩ±àÂë¸ù¼ò½à¡£
Òþ²ØÄã²»ÏëÈñðÈËÖªµÀµÄ²Ù×÷¡£
·Ç¾²Ì¬ÄÚ²¿Àà¶ÔÏóÓÐ×ÅÖ¸ÏòÆäÍⲿÀà¶ÔÏóµÄÒýÓÃ
Ò»¸ö¾²Ì¬³ÉÔ±À࣬ÈôÈ¥µô“static”¹Ø¼ü×Ö£¬¾Í³ÉΪ³ÉÔ±Àà¡£
package tao.test;
public class Outer {
public Outer(){
// ÔÚÄÚ²¿ÀàµÄÍⲿÀàµÄ¹¹Ôì·½·¨Öд´ÔìÄÚ²¿Àà¶ÔÏó
new Inner();
}
public static void fun(){
Outer out = new Outer();
Inner in = out.new Inner();
// Èç¹ûÄÚ²¿Àà±» static ÐÞÊΣ¬Ôò¿ÉÒÔ
// Inner in = new Inner();
}
//static class Inner{
class Inner{
public Inner(){
Outer out = new Outer();
}
public Outer getOuter(){
return Outer.this;
}
}
Ïà¹ØÎĵµ£º
Java NIO APIÏê½â
ÔÚJDK
1.4ÒÔÇ°£¬JavaµÄIO²Ù×÷¼¯ÖÐÔÚjava.ioÕâ¸ö°üÖУ¬ÊÇ»ùÓÚÁ÷µÄ×èÈû£¨blocking£©API¡£¶ÔÓÚ´ó¶àÊýÓ¦ÓÃÀ´Ëµ£¬ÕâÑùµÄAPIʹÓúܷ½
±ã£¬È»¶ø£¬Ò»Ð©¶ÔÐÔÄÜÒªÇó½Ï¸ßµÄÓ¦Óã¬ÓÈÆäÊÇ·þÎñ¶ËÓ¦Óã¬ÍùÍùÐèÒªÒ»¸ö¸üΪÓÐЧµÄ·½Ê½À´´¦ÀíIO¡£´ÓJDK 1.4Æð£¬NIO
API×÷Ϊһ¸ö»ùÓÚ»º³åÇø£¬²¢ÄÜÌṩ·Ç×èÈû(non-blo ......
SetºÍÊýѧÖеļ¯ºÏÊÇͬһ¸ö¸ÅÄ¾ÍÊÇûÓÐÖظ´ÔªËصļ¯ºÏ¡£
ÕâƪÎÄÕÂÖ÷ÒªÂÛÊöÁËSetÊÇÈçºÎʵÏÖ"ûÓÐÖظ´ÔªËØ"£¨no duplicate elements£©µÄ£¬ÒÔ¼°²ûÊöÁËʲôÊÇ“Öظ´”£¨duplicate£©£¬ÊÇÏàͬµÄµØÖ·¿Õ¼ä£¿ÊÇequalsµÄ·µ»ØֵΪtrue£¿ÊÇcompareToµÄ·µ»ØֵΪ0 £¿»¹ÊÇÓÐÏàͬµÄhashCode£¿±¾ÎÄ»¹¸ø³öÁËÔÚʲôÇé¿öÏÂʹÓÃʲà ......
package barchartdemo1;
import java.awt.Font;
import java.io.FileOutputStream;
import java.io.IOException;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartUtilities;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.CategoryAxis;
import org.jfree.chart.axis.Numbe ......
Ê×ÏÈ£¬Ç¿ÁÒÍƼöÄãÏȲο¼Sun¹Ù·½µÄJava´úÂë/±à³Ì¹æ·¶£º
http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html
Äã¿ÉÒÔ´òÆÆÒÔÉϵÄÈÎÒ»¹æÔò£¬²»¹ýÒ»¶¨ÒªÓиöºÃÀíÓÉ£¬²¢ÇҼǼÏÂÀ´¡£
ÓÀÔ¶£¬ÓÀÔ¶£¬ÓÀÔ¶²»ÒªÔÚûÓмǼ¶ÑÕ»¸ú×ÙÐÅÏ¢£¨stack trace£©»òÊÇÖØÐÂÅ׳öÒì³£µÄÇé¿öϲ¶»ñÒì³££¬Ë׳Ɠ³ÔµôÒì³£&rd ......
Ò»¡¢Array £¬ Arrays
JavaËùÓГ´æ´¢¼°Ëæ»ú·ÃÎÊÒ»Á¬´®¶ÔÏó”µÄ×ö·¨£¬arrayÊÇ×îÓÐЧÂʵÄÒ»ÖÖ¡£
1¡¢
ЧÂʸߣ¬µ«ÈÝÁ¿¹Ì¶¨ÇÒÎÞ·¨¶¯Ì¬¸Ä±ä¡£
array»¹ÓÐÒ»¸öȱµãÊÇ£¬ÎÞ·¨ÅжÏÆäÖÐʵ¼Ê´æÓжàÉÙÔªËØ£¬lengthÖ»ÊǸæËßÎÒÃÇarrayµÄÈÝÁ¿¡£
2¡¢JavaÖÐÓÐÒ»¸öArraysÀ࣬רÃÅÓÃÀ´²Ù×÷array¡£
a ......