JAVAÓë×ãÇò¶ÓµÄÏàËƵã
JAVAÓкöණ¶«
Ç°¼¸Ìì¿´ÁË¿´ ûÔõôͨÃ÷°×
½ñÌìÔ糿3µã45¿´ÁË»á ¹ú¼ÊÃ×À¼ ¿Í³¡ÌôÕ½ ÇжûÎ÷µÄ±ÈÈü
°¥Ñ½ ºÜˬ
ħÁ¦ÄñÖØ·µË¹Ì¹¸£ÇÅ
ÎÒ¾ÍÏë°¡ ÕâJAVA²»ÊÇÓиö»Ø·ÃµÄº¯ÊýÂð
ºÇºÇ ÍüÁ˽ÐɶÁË
°²ÇÐÂåµÙÔÚÃ×À¼Ê±ÆÚ¾³£±»¶¯µÄ°¤µ½Ä§Á¦ÄñµÄ¹ú¼ÊÃ×À¼µÄ´òѹ
ÕâºÎ³¢²»ÊÇJAVAÀïÃæµÄÄǸö¼Ì³ÐÂð
»¹ÓÐ ½ñÌì¹úÃ×ÔÚ·æÏßÉÏʹÓÃÁ˶àÃûÇ°·æ
Óа£Íа Ã×ÀûÍÐ ÒÔ¼°Å˵·ò
Õâ²»ÕýÊǶàÏß³ÌÂð
ºÇºÇ »¹ÓÐ ½ñÌìÄǸö¹úÃ׺ó·À´ó½« ¬Î÷°ÂÍâ¼ÓÃÅÉñÈûÈø¶ûºÎ³¢²»ÊÇJAVAµÄ½¡×³ÐÔÂð
»¹ÓÐ Öг¡×éÖ¯´óʦ˹Äڵ Õâ¸öÄѵÀ²»Ïñ¶¯Ì¬ÒÔ¼°¸ßÐÔÄÜ°¡
»¹ÓÐÄǸöĪËþºÍ¿²±ÈÑÇË÷ͦÏñJAVAÔËÐе±ÖеݲȫÐÔ
»¹ÓÐÄǸöµÂ¹úµÄ²ÃÅÐ ²»ÕýÊÇJAVAÀïÃæJavaÓïÑÔÊÇÌåϵ½á¹¹ÖÐÁ¢µÄÂï
ºÇºÇ ÇжûÎ÷²»¶à˵ÁË
ºÜ¿Éϧ µ«ÊÇËÈÃÄãÅöµ½ÎÒÒ»Ö±¾ÍºÜϲ»¶µÄ¹úÃ×ÄØ
°¥ Ã÷ÄêÄãÔÙÖØÀ´°É
Ïà¹ØÎĵµ£º
.»ù±¾¸ÅÄîµÄÀí½â
¾ø¶Ô·¾¶£º¾ø¶Ô·¾¶¾ÍÊÇÄãµÄÖ÷Ò³ÉϵÄÎļþ»òĿ¼ÔÚÓ²ÅÌÉÏÕæÕýµÄ·¾¶£¬(URLºÍÎïÀí·¾¶)ÀýÈ磺
C:xyz est.txt ´ú±íÁËtest.txtÎļþµÄ¾ø¶Ô·¾¶¡£http://www.sun.com/index.htmÒ²´ú±íÁËÒ»¸öURL¾ø¶Ô·¾¶¡£
Ïà¶Ô·¾¶£ºÏà¶ÔÓëij¸ö»ù׼Ŀ¼µÄ·¾¶¡£°üº¬WebµÄÏà¶Ô·¾¶£¨HTMLÖеÄÏà¶ÔĿ¼£©£¬ÀýÈ磺ÔÚ
ServletÖ ......
ÏÐÀ´ÎÞʽ«ÔçЩʱºòÒÑʵÏÖµÄQQµÇ¼½çÃæÔÙʵÏÖÁËÒ»±é£¬´¿ÊÖ¹¤´òÔ죨Òâ˼ÊÇûÓÐÓÃNetBeans¡¢MyEclipseµÄÍ϶¯¹¦ÄÜ£©¡£
Ô´´úÂëÈçÏ£º
package ibees.qq;
import java.awt.BorderLayout;
import java.net.URL;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import j ......
Java™ÓïÑÔ°üº¬Á½ÖÖÄÚÔÚµÄͬ²½»úÖÆ£ºÍ¬²½¿é£¨»ò·½·¨£©ºÍvolatile±äÁ¿¡£ÕâÁ½ÖÖ»úÖƵÄÌá³ö¶¼ÊÇΪÁËʵÏÖ´úÂëÏ̵߳ݲȫÐÔ¡£ÆäÖÐvolatile±äÁ¿µÄͬ²½ÐԽϲµ«ÓÐʱËü¸ü¼òµ¥²¢ÇÒ¿ªÏú¸üµÍ£©£¬¶øÇÒÆäʹÓÃÒ²¸üÈÝÒ׳ö´í¡£ÔÚÕâÆÚµÄJavaÀíÂÛÓëʵ¼ùÖУ¬Brian Goetz½«½éÉܼ¸ÖÖÕýȷʹÓÃvolatile±äÁ¿µÄģʽ£¬²¢Õë¶ÔÆäÊÊÓÃÐÔÏÞÖÆÌá³öÒ» ......
Ö»Õë¶Ô²»Õý³£µÄÌõ¼þ²ÅʹÓÃÒì³£
Òì³£Ö»Ó¦¸Ã±»ÓÃÓÚ²»Õý³£µÄÌõ¼þ£¬ËüÃÇÓÀÔ¶²»Ó¦±»ÓÃÓÚÕý³£µÄ¿ØÖÆÁ÷¡£
ÏÂÃæÊÇÒ»¸öÓÃÒì³£×÷±éÀú½áÊøÌõ¼þµÄÀÄÓÃÒì³£µÄÀý×Ó£º
//horrible abuse of exceptions. Don't ever do this!
try{
int i=0;
while(true)a[i++].f();
}catch(ArrayIndexOutOfBoundsException e){
......
Çë¿´ÏÂÃæÒ»Àý£º
public class TestAbstract {
int count;
public void operation(){
System.out.println("count = " + (++count));
}
}
public class Test extends TestAbstract {
public static void main(String[] args) {
Test test = new Test();
TestAbstract testAb = new TestAbstract();
testAb.operati ......