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

ÓÃJava³ÌÐòʵÏÖ½âѹËõÎļþ

package com.huawei.globe;
import java.util.zip.*;
import java.io.*;
public class Compress {
 public Compress() {
 }
 // ѹËõĿ¼ÏµÄÎļþ
 public void compress(String zipFileName, String inputFile) throws Exception {
  compress(zipFileName, new File(inputFile));
 }
 // ѹËõÎļþ
 public void compress(String zipFileName, File inputFile) throws Exception {
  ZipOutputStream out = new ZipOutputStream(new FileOutputStream(
    zipFileName));
  compress(out, inputFile, "");
  System.out.println("ѹËõ³É¹¦!");
  out.close();
 }
 public void compress(ZipOutputStream out, File f, String base)
   throws Exception {
  System.out.println("ÕýÔÚѹËõ  " + f.getName());
  if (f.isDirectory()) {
   File[] fl = f.listFiles();
   out.putNextEntry(new ZipEntry(base + "/"));
   base = base.length() == 0 ? "" : base + "/";
   for (int i = 0; i < fl.length; i++) {
    compress(out, fl[i], base + fl[i].getName());
   }
  } else {
   out.putNextEntry(new ZipEntry(base));
   FileInputStream in = new FileInputStream(f);
   int b;
   while ((b = in.read()) != -1)
    out.write(b);
   in.close();
  }
 }
 // ½âѹËõÎļþ
 public void upCompress(String zipFileName, String outputDirectory)
   throws Exception {
  ZipInputStream in = new ZipInputStream(new FileInputStream(zipFileName));
  ZipEntry z;
  while ((z = in.getNextEntry()) != null) {
   System.out.println("ÕýÔÚ½âѹ " + z.getName());
   if (z.isDirectory()) {
    String name = z.getName();
    name = name.subs


Ïà¹ØÎĵµ£º

javaÊý¾Ý½á¹¹Ö®¶ÓÁÐ

ÔÚʹÓöÓÁÐÖУ¬ÎÒÃÇÒ»°ã¶¼»áʹÓÃÑ­»·¶ÓÁÐÒÔ±£Ö¤ÐÔÄÜ
package com.yz.myqueue;
public class Queue {
private Integer size;
private Integer front;
private Integer rear;
private Object[] datas;
public Queue(int size){
this.size=size;
this.front=-1;
this.rear=-1;
datas=new Object[size] ......

Java¸´Ï°±Ê¼Ç µÚ6Ìì

Èí¼þ¿ª·¢»ù´¡
       ¼ÆËã»úÊÇÖ´ÐгÌÐòÖ¸ÁîµÄµç×ÓÉ豸£¬ÊäÈë¡¢Êä³ö¡¢´æ´¢ºÍ´¦Àí
       CPU²¿¼þ£ºËãÊõÂß¼­µ¥Ôª(ALU)£¬¿ØÖƵ¥Ôª
       ´æ´¢Æ÷£ºÖ÷´æ´¢Æ÷£¨ÁÙʱ´æ´¢Êý¾Ý£©£¬¸¨Öú´æ´¢Æ÷£¨ÓÀ¾Ã´æ´¢£©
     ......

Java equals

boolean java.lang.Object.equals(Object obj)
Indicates whether some other
object is "equal to" this one.
The equals method implements an
equivalence relation on non-null object references:
It is reflexive: for
any non-null reference value x, x.equals(x) should return true.
It ......

javaµÄ»ù±¾Ë¼Ïë

³     Java ÓïÑÔÖУ¬¶Ô¸÷ÖÖ±äÁ¿¡¢·½·¨ºÍÀàµÈÒªËØÃüÃûʱʹÓõÄ×Ö·ûÐòÁгÆÎª±êʶ·û¡£
      --·²ÊÇ×Ô¼º¿ÉÒÔÆðÃû×ֵĵط½¶¼½Ð±êʾ·û£¬¶¼×ñÊØ±êʾ·ûµÄ¹æÔò¡£
³     Java ±êʶ·ûÓÐÈçÏÂÃüÃû¹æÔò£º
–     ±êʶ·ûÓÉ×Öĸ¡ ......

java_Ñ¡ÔñÅÅÐò·¨

Java ʵÏÖµÄÑ¡ÔñÅÅÐò·¨£¬ÏÈÔÚNetbeansÀïµ÷ÊÔÔËÐÐÁËһϣ¬È»ºóÓÖÔÚEclipseÁËÔËÐÐÁËһϡ£
public class ArraySort {
     public static void main(String[] args) {
     int Arrays[]={50,45,2,678,90,40,};
     int i,j,temp,min;
     int len=Array ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ