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

JAVAÖеĴ«µÝ¶¼ÊÇÖµ´«µÝÂð£¿ÓÐûÓÐÒýÓô«µÝÄØ£¿

JAVAÖеĴ«µÝ¶¼ÊÇÖµ´«µÝÂð£¿ÓÐûÓÐÒýÓô«µÝÄØ£¿
ÔڻشðÕâÁ½¸öÎÊÌâÇ°£¬ÈÃÎÒÃÇÊ×ÏÈÀ´¿´Ò»¶Î´úÂ룺
Java´úÂë
public class ParamTest {
// ³õʼֵΪ0
protected int num = 0;
// Ϊ·½·¨²ÎÊýÖØи³Öµ
public void change(int i) {
i = 5;
}
// Ϊ·½·¨²ÎÊýÖØи³Öµ
public void change(ParamTest t) {
ParamTest tmp = new ParamTest();
tmp.num = 9;
t = tmp;
}
// ¸Ä±ä·½·¨²ÎÊýµÄÖµ
public void add(int i) {
i += 10;
}
// ¸Ä±ä·½·¨²ÎÊýÊôÐÔµÄÖµ
public void add(ParamTest pt) {
pt.num += 20;
}
public static void main(String[] args) {
ParamTest t = new ParamTest();
System.out.println("²ÎÊý--»ù±¾ÀàÐÍ");
System.out.println("Ô­ÓеÄÖµ£º" + t.num);
// Ϊ»ù±¾ÀàÐͲÎÊýÖØи³Öµ
t.change(t.num);
System.out.println("¸³ÖµÖ®ºó£º" + t.num);
// ΪÒýÓÃÐͲÎÊýÖØи³Öµ
t.change(t);
System.out.println("ÔËËãÖ®ºó£º" + t.num);
System.out.println();
t = new ParamTest();
System.out.println("²ÎÊý--ÒýÓÃÀàÐÍ");
System.out.println("Ô­ÓеÄÖµ£º" + t.num);
// ¸Ä±ä»ù±¾ÀàÐͲÎÊýµÄÖµ
t.add(t.num);
System.out.println("¸³ÒýÓúó£º" + t.num);
// ¸Ä±äÒýÓÃÀàÐͲÎÊýËùÖ¸Ïò¶ÔÏóµÄÊôÐÔÖµ
t.add(t);
System.out.println("¸ÄÊôÐÔºó£º" + t.num);
}
}
public class ParamTest {
// ³õʼֵΪ0
protected int num = 0;
// Ϊ·½·¨²ÎÊýÖØи³Öµ
public void change(int i) {
i = 5;
}
// Ϊ·½·¨²ÎÊýÖØи³Öµ
public void change(ParamTest T) {
ParamTest tmp = new ParamTest();
tmp.num = 9;
T = tmp;
}
// ¸Ä±ä·½·¨²ÎÊýµÄÖµ
public void add(int i) {
i += 10;
}
// ¸Ä±ä·½·¨²ÎÊýÊôÐÔµÄÖµ
public void add(ParamTest pt) {
pt.num += 20;
}
public static void main(String[] args) {
ParamTest t = new ParamTest();
System.out.println("²ÎÊý--»ù±¾ÀàÐÍ");
System.out.println("Ô­ÓеÄÖµ£º" + t.num);
// Ϊ»ù±¾ÀàÐͲÎÊýÖØи³Öµ
t.change(t.num);
System.out.println("¸³ÖµÖ®ºó£º" + t.num);
// ΪÒýÓÃÐͲÎÊýÖØи³Öµ
t.change(t);
System.out.println("ÔËËãÖ®ºó£º" + t.num);
System.out.println();
t = new ParamTest();
System.out.println("²ÎÊý--ÒýÓÃÀàÐÍ");
System.ou


Ïà¹ØÎĵµ£º

JavaÐÔÄÜÓÅ»¯¼¼Çɼ¯½õ

1.1 ²»ÓÃnew¹Ø¼ü´Ê´´½¨ÀàµÄʵÀý
¡¡¡¡ÓÃnew¹Ø¼ü´Ê´´½¨ÀàµÄʵÀýʱ£¬¹¹Ô캯ÊýÁ´ÖеÄËùÓй¹Ô캯Êý¶¼»á±»×Ô¶¯µ÷Óᣵ«Èç¹ûÒ»¸ö¶ÔÏóʵÏÖÁËCloneable½Ó¿Ú£¬ÎÒÃÇ¿ÉÒÔµ÷ÓÃËüµÄclone()·½·¨¡£clone()·½·¨²»»áµ÷ÓÃÈκÎÀ๹Ô캯Êý¡£
¡¡¡¡ÔÚʹÓÃÉè¼Æģʽ£¨Design Pattern£©µÄ³¡ºÏ£¬Èç¹ûÓÃFactoryģʽ´´½¨¶ÔÏó£¬Ôò¸ÄÓÃclone()·½·¨´´½¨Ðµ ......

100ÐÐJava´úÂë¹¹½¨Ò»¸öÏ̳߳Ø

ÔÚÏÖ´úµÄ²Ù×÷ϵͳÖУ¬ÓÐÒ»¸öºÜÖØÒªµÄ¸ÅÄî¨D¨DỊ̈߳¬¼¸ºõËùÓÐÄ¿Ç°Á÷ÐеIJÙ×÷ϵͳ¶¼Ö§³ÖỊ̈߳¬Ïß³ÌÀ´Ô´ÓÚ²Ù×÷ϵͳÖнø³ÌµÄ¸ÅÄ½ø³ÌÓÐ×Ô¼ºµÄÐéÄâµØÖ·¿Õ¼äÒÔ¼°ÕýÎĶΡ¢Êý¾Ý¶Î¼°¶ÑÕ»£¬¶øÇÒ¸÷×ÔÕ¼Óв»Í¬µÄϵͳ×ÊÔ´£¨ÀýÈçÎļþ¡¢»·¾³±äÁ¿µÈµÈ£©¡£Óë´Ë²»Í¬£¬Ï̲߳»Äܵ¥¶À´æÔÚ£¬ËüÒÀ¸½ÓÚ½ø³Ì£¬Ö»ÄÜÓɽø³ÌÅÉÉú¡£Èç¹ûÒ»¸ö½ø³ÌÅÉÉú³öÁË ......

Java ¹ýÂ˲»°²È«×Ö·û

public   static   String   htmlEncode(String   pstrWord)    
  {  
        if((pstrWord   !=   null)&&(pstrWord   !=   ""))  
......

JAVAÅàѵÌâ¿â Servlet

1£®Servlet³ÌÐòµÄÈë¿ÚµãÊÇ£º£¨ £©
A  init£¨£© 
B  main£¨£© 
C  service£¨£© 
D  doGet£¨£©
²Î¿¼´ð°¸£ºA
2. SeverletÖУ¬HttpSeverletResponseµÄʲô·½·¨ÓÃÀ´°ÑÒ»¸öHTTPÇëÇóÖض¨Ïòµ½ÁíÍâµÄURL£¿£¨ £©
A  sendURL()
B  redirectURL()
C  sendRedirect()
D ......

ʹÓÃJavaÔÚÎļþÀï²åÈëÒ»ÐÐ

ÔÚÎļþÀïÔö¼ÓÒ»ÐеÄΨһ·½·¨¾ÍÊǶÁȡԭʼÎļþ£¬È»ºóдÈëµ½Ò»¸öÁÙʱÎļþ£¬Í¬Ê±Ð´ÈëÒª²åÈëµÄÊý¾Ý¡£È»ºóɾ³ýԭʼÎļþ£¬ÔÙ°ÑÁÙʱÎļþ¸ÄÃûΪԭʼÎļþÃû¡£
package net.java2000.io; 
 
import java.io.BufferedReader; 
import java.io.File; 
import java.io.FileInputStream; 
import jav ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ