2010Äê3ÔÂ4 6ÈÕJava½Ï¶à
Õ⼸ÌìÍøÂçÓÐÎÊÌ⣬ËùÒÔ½ñÌìÒ»Æð×ܽá³öÀ´
ÀàµÄС½á
1£¬Àà³éÏóÁËËùÓоßÓÐÒ»¶¨¹²ÐÔµÄʵÌåµÄ¹²Í¬Ìسơ£Ò»¸öÀàÖУ¬±äÁ¿ÓÃÀ´±íʾÊôÐÔ£¬·½·¨ÓÃÀ´±íʾ¹¦ÄÜ£¬Àà°ÑÊý¾ÝºÍ¶ÔÊý¾ÝµÄ²Ù×÷·â×°³ÉÒ»¸öÕûÌå¡£³ÌÐòÓïÑÔÖУ¬Í¨¹ýÀà´´½¨¶ÔÏó¡£
2£¬¹¹Ô캯ÊýµÄ×÷ÓÃÔÚÓÚÉùÃ÷ÀàµÄ¶ÔÏóºó£¬ÎªÆä·ÖÅä´¢´æµ¥Ôª£¬¼´´´½¨ÊµÀý¡£
3,²»Í¬¶ÔÏóµÄʵÀý±äÁ¿½«±»·ÖÅ䲻ͬµÄÄÚ´æ¿Õ¼ä£¬ËùÓжÔÏóµÄÀà±äÁ¿¶¼·ÖÅä¸øÏàͬµÄÒ»¿éÄÚ´æ¿Õ¼ä¡£
4£¬¶ÔÏóÊÇÒýÓÃÐͱäÁ¿¡£¶ÔÏóµ÷ÓñäÁ¿¼°·½·¨»áÊܵ½È¨ÏÞµÄÏÞÖÆ£¬Javaͨ¹ýÐÞÊηûpublic private protectedµÈÀ´ËµÃ÷ʹÓÃȨÏÞ£¬ÔÚȨÏÞ·¶Î§ÄÚ£¬¶ÔÏó¹ýͨ¹ýµ÷Ó÷½·¨¿ÉÒÔ²úÉúÒ»¶¨ÐÐΪ¡£
5£¬ÊµÀý·½·¨Ö»ÄÜÓɶÔÏóµ÷Óã¬ÊµÀý·½·¨¼ÈÄܶÔÀà±äÁ¿²Ù×÷Ò²ÄܶÔʵÀý±äÁ¿²Ù×÷£¬Àà·½·¨¼È¿ÉÓɶÔÏóµ÷Óã¬ÓÖ¿ÉÖ±½ÓÓÉÀàÃûµ÷Ó㬶øÀà·½·¨Ö»ÄܶÔÀà±äÁ¿½øÐвÙ×÷¡£
6£¬°üÊÇJavaÓï¾äÖÐÓÐЧ¹ÜÀíÀàµÄ»úÖÆ¡£Èç¹ûÀàÔÚͬһ¸ö°üÖУ¬ÄÇôÏàÓ¦¶ÔÏóÄÜ·ÃÎÊ×Ô¼ºµÄÓкóÉÔ±£¬Èç¹ûÀ಻ÔÚͬһ¸ö°üÖУ¬ÄÇôÏàÓ¦¶ÔÏóÖ»ÄÜ·ÃÎÊpublicºÍprotected³ÉÔ±¡£
ÔÚ³ÌÐòÖУ¬ÀàÖ÷ÒªÓÐÁ½¸öÈÎÎñ£»
1£¬ÀඨÒåÁËÓëÆäÓйصijéÏóÎÎÒÃÇ¿ÉÒÔʹÓÃÀàÃèÊöÕæÊÇÊÀ½çµÄʵÌ壬ÎÞÂÛËûÃÇÓжิÔÓ¡£
2£¬ÀàÊdzÌÐòÄ£¿é»¯µÄ»ù´¡¡£
ÔÚϵͳ¹¹ÔìÖо¡¿ÉÄÜÔËÓÃÈËÀàµÄ×ÔȻ˼ά·½Ê½£¬ÕâÖÖÉè¼Æ·½·¨·ûºÏÎÒÃǵÄ˼άϰ¹ß¡£
ÀàµÄ»úÖÆ°ÑijЩÊý¾Ý³ÉÔ±ºÍ·½·¨¶ÔÍâ·â×°ÆðÀ´£¬ÒÔÃâ±»²»Õýµ±µÄ´æ¡¢È¡¡£
ÃæÏò¶ÔÏó¼¼ÊõÖУ¬¶ÔÏóµÄ״̬Óà ±äÁ¿ ±íʾ£¬¶ÔÏóµÄÐÐΪÓà ·½·¨ ±íʾ¡£
ʹÓÃÒ»¸ö¶ÔÏóÇ°£¬±ØÐëÉùÃ÷²¢ new Ëü¡£
³ÉÔ±±äÁ¿ÔÚ Àà ÖÐÓÐЧ£¬¾Ö²¿±äÁ¿Ö»ÔÚ ·½·¨ ÖÐÓÐЧ¡£
1£¬¹¹Ôì·½·¨µÄÓÃ;ºÍÌص㣺
´´½¨ÄÚ´æ¿Õ¼ä£¬Ìص㣬·½·¨ÃûºÍÀàÃûÏàͬ£¬ÎÞ·µ»ØÖµ£¬void
2.¾ÙÀý˵Ã÷Àà·½·¨ºÍʵÀý·½·¨£¬ÒÔ¼°Àà±äÁ¿ºÍʵÀý±äÁ¿µÄÇø±ð¡£
ʵÀý·½·¨¿ÉÒÔ·ÃÎÊʵÀý±äÁ¿ºÍÀà±äÁ¿£¬Àà·½·¨Ö»ÄÜ·ÃÎÊÀà±äÁ¿£¬Àà±äÁ¿¿ÉÒÔÖ±½Ó±»ÀàÃûµ÷Óã¬ÊµÀý±äÁ¿±ØÐëÓɶÔÏóµ÷Óá£Í¬Ò»¸öÀàÖУ¬Àà±äÁ¿¹«ÓÃÒ»¿éÄÚ´æ¡£
///////////////////////////////////
g.setFont(new Font("ËÎÌå"Font.BOLD,36));
///////////////////////////////////
ÀàµÄ¼Ì³ÐÐÔÓë¶à̬ÐÔ
class ×ÓÀàÃû extends ¸¸ÀàÃû
{
}
Óɼ̳жøµÃµ½µÄÀ࣬½Ð×ö×ÓÀà»òÕßÅÉÉúÀ࣬±»¼Ì³ÐµÄÀà½Ð×ö¸¸Àà»òÕß³¬Àà¡£
1£¬ObjectÊÇ°ü java.langÖеÄÀà
2£¬Ààjava.long.Object ´¦ÓÚJava¿ª·¢»·¾³µÄÀàµÄ²ã´ÎµÄ¸ù²¿£¬ÆäËüËùÓÐÀ࣬¶¼Ö±½Ó»òÕß¼ä½ÓµÄ¼Ì³ÐÁËËü¡£
3£¬toString()ÊÇObjectÀàÖеij£Ó÷½·¨£¬ÓÃÀ´·µ»Ø¶ÔÏóµÄ×Ö·û´®±íʾ¡£
¼Ì³ÐʵÏÖÁËÈí¼þµÄÖØÓá
Ïà¹ØÎĵµ£º
public class bubblesort {
public static void main(String[] args) {
int array[]=new int[]{1,5,9,4,6,2};
int m;
for(int i=0;i<array.length;i++){
System.out.print(arra ......
ijЩÍøÕ¾ÔÊÐíÈí¼þ¿ª·¢ÉçÍÅͨ¹ý·¢²¼¿ª·¢ÕßÖ¸ÄÏ¡¢°×ƤÊé¡¢FAQs¡¾³£¼ûÎÊÌâ½â´ð¡¿ºÍÔ´´úÂëÒÔʵÏÖÐÅÏ¢µÄ¹²Ïí¡£Ëæ×ÅÐÅÏ¢Á¿µÄÔö³¤£¬ºÍ¼¸¸ö¿ª·¢Õß¹±Ï׳ö×Ô¼ºµÄ֪ʶ¿â£¬ÓÚÊÇÍøÕ¾ÌṩËÑË÷ÒýÇæÀ´ËÑË÷Õ¾µãÉÏÏÖÓеÄËùÓÐÐÅÏ¢¡£ËäÈ»ÕâЩËÑË÷ÒýÇæ¶ÔÎı¾ÎļþµÄËÑË÷¿ÉÒÔ×öµÄºÜºÃ£¬µ«¶Ô¿ª·¢ÕßËÑË÷Ô´´úÂë×öÁ˱ȽÏÑϸñµÄÏÞÖÆ¡£ËÑË÷ÒýÇæÈÏΪԴ´úÂë ......
ÔÚJava concurrent°üÖÐÓÐÕâôһ¸ö½Ó¿Ú£ºConcurrentMap¡£
ConcurrentMap¼Ì³Ð×ÔMap£¬²¢Ìí¼ÓÁ˼¸¸öеÄÔ×Ó·½·¨£º putIfAbsent¡¢remove¡¢replace
Æä·½·¨ÕªÒªÈçÏ£º
V
putIfAbsent(K key, V value)
Èç¹ûÖ¸¶¨¼üÒѾ²»ÔÙÓëij¸öÖµÏà¹ØÁª£¬Ôò½ ......
Ò»¡¢Java ClassLoader
1£¬Ê²Ã´ÊÇClassLoader
Óë C »ò C++ ±àдµÄ³ÌÐò²»Í¬£¬Java ³ÌÐò²¢²»ÊÇÒ»¸ö¿ÉÖ´ÐÐÎļþ£¬¶øÊÇÓÉÐí¶à¶ÀÁ¢µÄÀàÎļþ×é³É£¬Ã¿Ò»¸öÎļþ¶ÔÓ¦ÓÚÒ»¸ö Java Àà¡£
´ËÍ⣬ÕâЩÀàÎļþ²¢·ÇÁ¢¼´È«²¿¶¼×°ÈëÄڴ棬¶øÊǸù¾Ý³ÌÐòÐèҪװÈëÄÚ´æ¡£ClassLoader ÊÇ JVM Öн«Àà×°ÈëÄÚ´æµÄÄDz¿·Ö¡£
¶øÇÒ£¬Java ClassLoader ......
import java.util.Enumeration;
public class CipherTest implements Enumeration {
private int N;
private int c[], k;
private Object[] objs;
public CipherTest(Object[] items) {
N = items.length;
c = new int[N + 1];
for (int i = 0; i <= N; i++)
c[i] = i;
objs = items;
k = 1 ......