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

java ½âѹËõzipÎļþ

²âÊÔ»·¾³£ºwin2000+jdk1.4+jb2006
 import java.io.*;
import java.util.Enumeration;
//import java.util.zip.*;
import org.apache.tools.zip.*;
public class Test {
//½âѹÎļþ
  public static void extZipFileList(String zipFileName, String extPlace) {
    try {
      ZipFile zipfile=new ZipFile(zipFileName);
      InputStream in = null;
      ZipEntry entry = null;
      File files = new File(extPlace);
      if (files.exists() == false) {
        files.mkdirs();
      }
      String inpath = extPlace;
      Enumeration ea=zipfile.getEntries();
      while ( ea.hasMoreElements()) {
        entry=(ZipEntry)ea.nextElement();
        String entryName = entry.getName();
        if (entry.isDirectory()) {
          File file = new File(extPlace + entryName);
          file.mkdirs();
          inpath += "/" + file.getName();
        }
        else {
          File newfile=new File(extPlace+File.separator+entryName.substring(0,entryName.lastIndexOf("/")+1));
          newfile.mkdirs();
          newfile=new File(extPlace+File.separator+entryName);
          newfile.createNewFile();
          FileOutputStream os = new FileOutputStream(newfile);


Ïà¹ØÎĵµ£º

java Ï̵߳÷ÓÃHttpClientµÄʵÁ¦

×¢Òâ,Óõ½ÁËÄÚ²¿Àà:
new Thread
   (
     new Runnable()
     {
      public void run()
      {
       try
    &n ......

java ¶¯Ì¬´úÀí


1¡¢Ê×ÏȱØÐëÓиö½Ó¿Ú
package reflection;
public interface HelloWorld {
    void sayHelloWorld();
    void testHello(String hello);
}
2¡¢½Ó¿ÚµÄʵÏÖÀà
package reflection;
public class HelloWorldImpl implements HelloWorld {
 public void sayHelloWorld() {
&n ......

javaÓëc++Óï·¨Çø±ð

//1.JavaÖÐ×Ö·û´®²»ÄܶàÐÐÊéд¡£¶àÐÐÊéдÓÃÒýºÅ¸ô¶Ï£¬¼ÓºÅÏàÁ¬¡£  
  //2.JavaµÄ±êʶ·û¿ÉÒÔÓÃÃÀÔª·ûºÅ¿ªÍ·¡£  
  //3.JavaÖÐûÓÐÎÞ·ûºÅ±äÁ¿»òÎÞ·ûºÅ³£Á¿µÄ¸ÅÄî¡£ËùÓеıäÁ¿¶¼ÊÇÓзûºÅµÄ¡£  
  //4.JavaÖбäÁ¿µÄ×Ö³¤Êǹ̶¨µÄ¡£²»´æÔÚcharºÍwcharÖ®·Ö¡£  
  //5.JavaÖбäÁ¿Î ......

Java IO InputStreamReader

      ºÜ¶àµÄÎı¾Îļþ»áÓв»Í¬µÄ±àÂë¸ñʽ£¬Ôì³ÉÕâÖÖ±àÂë²îÒìµÄ¿ÉÄÜÊÇϵͳµÄ²îÒ죬¿ÉÄÜÊÇÔÚ±£´æÎļþʱ²ÉÓÃÌØ¶¨µÄ×Ö·û¼¯±àÂëÀ´±£´æ¡£ÕâʱÎÒÃÇÀûÓÃJavaÓïÑÔÀ´´ò¿ªÕâЩÎı¾Ê±£¬Èç¹û²»Ê¹ÓÃÕýÈ·µÄ×Ö·û¼¯½âÂëÆ÷´ò¿ª£¬¿Ï¶¨»á³öÏÖÂÒÂë¡£ºÃÔÚjava.io°üÌṩÁËÒ»¸öjava.io.InputStreamReaderÀàÀ´Ö§³ÖÖ¸¶¨Îı¾× ......

Java×Ô¶¨Òå¶àÏ̷߳þÎñÆ÷

// multi.MultiServer.java
package multi;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
public class MultiServer {
private int port = 8000;
private int backlog = 42;
private ServerSocket server_socket;
private Thread ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ