ÓÉJava toy programme µÃ³öµÄ¾Ñé¼°½Ìѵ
ѧϰJava´ó¸ÅÒ»¸öÔÂÁË£¬ÓÉÓÚÒÔǰÓÐc/c++»ù´¡£¬ËùÒÔÔÚJ2SE²¿·ÖµÄѧϰÊDZȽϿìµÄ£¬½ñÌìÔÚÂÛ̳¿´µ½Ò»¸öÍøÓѵÄÇóÖúÌû£¬Òª½«Ó²ÅÌÉÏÁ½¸öÎļþºÏ²¢ÎªÒ»¸ö²¢É¾³ýÔÎļþ£¬ÓÚÊDZãдÁ˲âÊÔ³ÌÐò¡£ºóÀ´ÔÚɾ³ýÎļþʱ£¬ÓÉÓÚûÓаѶµ½ÎļþÉϵÄÊä³öÁ÷¹Ø±Õ£¬µ¼ÖÂÔõôҲÎÞ·¨É¾³ý¡£¶øÇÒÒ»Ö±²é²»³öÔÒò£¬ºóÀ´ÒÔΪÊÇdelete·½·¨Ö»ÄÜɾ³ý¿ÕÎļþ£¬Ò»google£¬ÔÚ¿´Ìû¹ý³ÌÖÐͻȻÒâʶµ½×Ô¼ºµÄÊä³öÁ÷û¹Ø±Õ£¬Ð޸ijÌÐòºó£¬Õý³£ÁË¡£´ÓÖУ¬Ìå»áµ½Ð´³ÌÐòºÃϰ¹ßÕæµÄÊǺÜÖØÒªµÄ¡£¼ÌÐø³É³¤ing¡£¡£¡£¡£¡£¡£¡£¡£
java code
import java.io.*;
public class HandleFile {
public static void main(String[] args) throws Exception {
if(args.length == 0) return ;
else{
File[] f = new File[args.length];
File objectFile = new File("G:\\object.txt");
BufferedReader buf = null;
BufferedWriter bw = new BufferedWriter(new FileWriter(objectFile));
String line = null;
for(int i=0; i<args.length; i++) {
f[i] = new File(args[i]);
System.out.println(f[i]);
buf = new BufferedReader(new FileReader(f[i]));
line = buf.readLine();
while(line != null) {
bw.write(line);
bw.flush();
bw.newLine();
line = buf.readLine();
if(line == null) {
buf.close();
System.out.println("µÚ" + i +"¸öÎļþÍê±Ï");
if(f[i].delete()) System.out.println("ÒÑɾ³ý");
}
}
}
}
}
}
Ïà¹ØÎĵµ£º
×î½üÒòΪÏîÄ¿ÐèÒª£¬Ñо¿ÁËjava html parserÀà¿âµÄÓ¦Ó᣼ǼÏÂʹÓÃÒªµã£º
Ö÷ÒªµÄÀà˵Ã÷£º
1¡¢ParserÀà
½âÎöÆ÷Ö÷À࣬¸ºÔðÔØÈëHTML´úÂë²¢½âÎö¡£
2¡¢Node½Ó¿Ú
ÓÃÀ´±íÕ÷ÔÚ½âÎö¹ý³ÌÖÐʹÓõÄÓï·¨µ¥Ôª¡£Ê¾ÀýÈç϶Îhtml´úÂ룺
<span> ----Tag node
text ----Text Node
</span>
Îı¾ºÍ±êÇ©¶¼ÊǶÀÁ¢µÄnodeÔªËØ¡ ......
ÔÚJava
ÓïÑÔÖУ¬ abstract class ºÍinterface
ÊÇÖ§³Ö³éÏóÀà
¶¨
ÒåµÄÁ½ÖÖ»úÖÆ¡£ÕýÊÇÓÉÓÚÕâÁ½ÖÖ»úÖÆµÄ´æÔÚ£¬²Å¸³ÓèÁËJavaÇ¿´óµÄ ÃæÏò¶ÔÏóÄÜÁ¦¡£abstract
classºÍinterfaceÖ®¼äÔÚ¶ÔÓÚ³éÏóÀඨÒåµÄÖ§³Ö·½Ãæ¾ßÓкܴóµÄÏàËÆÐÔ£¬ÉõÖÁ¿ÉÒÔÏà»¥Ìæ»»£¬Òò´ËºÜ¶à¿ª·¢ÕßÔÚ½ø
ÐгéÏóÀඨÒåʱ¶ÔÓÚabstract
classºÍinterfaceµÄÑ¡Ô ......
ÔÚ Java ÀíÂÛºÍʵ¼ù µÄ ǰһÆÚÎÄÕ ÖУ¬Java™ Çå½à¹¤³Ìʦ Brian Goetz ̽¾¿ÁËÈõÒýÓã¨weak references£©£¬ËüÈÃÄú¾¯¸æÀ¬»øÊÕ¼¯Æ÷£¬ÄúÏëҪά»¤Ò»¸ö¶ÔÏóµÄÒýÓ㬶ø²»»á×èÖ¹¸Ã¶ÔÏó±»À¬»øÊÕ¼¯¡£ÔÚ±¾ÆÚÎÄÕÂÖУ¬Ëû½«½âÊÍ Reference ¶ÔÏóµÄÁíÍâÒ»ÖÖÐÎʽ£¬¼´ÈíÒýÓã¨soft references£©£¬ÓÃÓÚ°ïÖúÀ¬»øÊÕ¼¯Æ÷¹ÜÀíÄÚ´æÊ¹ÓúÍÏû³ýÇ ......
DWRÊÇÒ»¸ö¿ò¼Ü£¬¼òµ¥µÄ˵¾ÍÊÇÄܹ»ÔÚjavascriptÖ±½Óµ÷ÓÃjava·½·¨£¬¶ø²»±ØÈ¥Ð´Ò»´ó¶ÑµÄjavascript´úÂë¡£ËüµÄʵÏÖÊÇ»ùÓÚajaxµÄ£¬¿ÉÒÔʵÏÖÎÞË¢ÐÂЧ¹û¡£
ÍøÉÏÓв»ÉÙDWRµÄÀý×Ó£¬µ«´ó¶¼Ö»ÊÇijÖÖ·½·¨µÄµ÷Ó㬱¾ÎÄÖ»ÔÚʹÓòãÃæÉϽéÉÜDWR£¬²¢²»Éæ¸ü¶àµÄ¼¼ÊõÓëÉè¼Æ£¬ÆäÄ¿µÄÊÇÈóõѧÕßÄܹ»ºÜ¿ìµÄѧ»á¸÷ÖÖjava·½·¨ÔÚjavascriptÖÐÊÇÈçºÎµ ......
¡¡¡¡(1) ÀàÃûÊ××ÖĸӦ¸Ã´óд¡£×ֶΡ¢·½·¨ÒÔ¼°¶ÔÏó(¾ä±ú)µÄÊ××ÖĸӦСд¡£¶ÔÓÚËùÓбêʶ·û£¬ÆäÖаüº¬µÄËùÓе¥´Ê¶¼Ó¦½ô¿¿ÔÚÒ»Æð£¬¶øÇÒ´óдÖм䵥´ÊµÄÊ××Öĸ¡£ÀýÈ磺
¡¡¡¡ThisIsAClassName
¡¡¡¡thisIsMethodOrFieldName
¡¡¡¡ÈôÔÚ¶¨ÒåÖгöÏÖÁ˳£Êý³õʼ»¯×Ö·û£¬Ôò´óдstatic final»ù±¾ÀàÐͱêʶ·ûÖеÄËùÓÐ×Öĸ¡£ÕâÑù±ã¿É±êÖ¾³öË ......