javaÃæÊÔÌâ2
18.×öÒ»¸öµ¥×ÓģʽµÄÀֻ࣬¼ÓÔØÒ»´ÎÊôÐÔÎļþ
package com.softeem.demo;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
/**
*@authorleno
*µ¥×Óģʽ£¬±£Ö¤ÔÚÕû¸öÓ¦ÓÃÆÚ¼äÖ»¼ÓÔØÒ»´ÎÅäÖÃÊôÐÔÎļþ
*/
publicclass Singleton {
privatestatic Singleton instance;
privatestaticfinal String CONFIG_FILE_PATH = "E:\\config.properties";
private Properties config;
private Singleton()
{
config = new Properties();
InputStream is;
try {
is = new FileInputStream(CONFIG_FILE_PATH);
config.load(is);
is.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
publicstatic Singleton getInstance()
{
if(instance==null)
{
instance = new Singleton();
}
returninstance;
}
public Properties getConfig() {
returnconfig;
}
publicvoid setConfig(Properties config) {
this.config = config;
}
}
l J2SE
19.¿½±´Ò»¸öĿ¼(Îļþ)µ½Ö¸¶¨Â·¾¶
/**
*¿½±´Ò»¸öĿ¼»òÕßÎļþµ½Ö¸¶¨Â·¾¶ÏÂ
*@paramsource
*@pa
Ïà¹ØÎĵµ£º
Javaѧϰ´ÓÈëÃŵ½¾«Í¨
Ò»¡¢ JDK (Java Development Kit)
JDKÊÇÕû¸öJavaµÄºËÐÄ£¬°üÀ¨ÁËJavaÔËÐл·¾³£¨Java Runtime Envirnment£©£¬Ò»¶ÑJava¹¤¾ßºÍJava»ù´¡µÄÀà¿â(rt.jar)¡£²»ÂÛʲôJavaÓ¦Ó÷þÎñÆ÷ʵÖʶ¼ÊÇÄÚÖÃÁËij¸ö°æ±¾µÄJDK¡£Òò´ËÕÆÎÕJDKÊÇѧºÃJavaµÄµÚÒ»²½¡£×îÖ÷Á÷µÄJ ......
Õâ¸öÎÊÌâ½ñÌìÖÕÓÚ¿´Ò»¸ö¸çÃǶùµÄÎÄÕ¸㶨ÁË£¬ÔÚ´Ëлл£¡ËùÒÔתÔØÒ»ÏÂ
=============================================================
java-package°üµÄʹÓ÷½·¨
¡¡¡¡
µ±Ò»¸ö´óÐͳÌÐò½»ÓÉÊý¸ö²»Í¬µÄ³ÌÐòÈËÔ±¿ª·¢Ê±£¬Óõ½ÏàͬµÄÀàÃûÊǺÜÓпÉÄܵģ¬ÄÇôÈç¹û·¢ÉúÁËÕâÑùµÄʼþÎÒÃǸÃÔõô°ìÄÇ£¿£¬ÔÚÎÒÃÇjava³ÌÐò¿ª ......
ÍùÍù»ìÏýÁËÕâÈý¸öº¯ÊýµÄʹÓá£
´Ó²Ù×÷ϵͳµÄ½Ç¶È½²£¬os»áά»¤Ò»¸öready queue£¨¾ÍÐ÷µÄÏ̶߳ÓÁУ©¡£²¢ÇÒÔÚijһʱ¿ÌcpuֻΪready queueÖÐλÓÚ¶ÓÁÐÍ·²¿µÄÏ̷߳þÎñ¡£
µ«Êǵ±Ç°ÕýÔÚ±»·þÎñµÄÏ߳̿ÉÄܾõµÃcpuµÄ·þÎñÖÊÁ¿²»¹»ºÃ£¬ÓÚÊÇÌáÇ°Í˳ö£¬Õâ¾ÍÊÇyield¡£
»òÕßµ±Ç°ÕýÔÚ±»·þÎñµÄÏß³ÌÐèҪ˯һ»á£¬ÐÑÀ´ºó¼ÌÐø±»·þÎñ£¬Õâ¾ÍÊ ......
Sun¹«Ë¾Ò»ÃûÔ±¹¤×Ô¼º´´×÷µÄ¸è£¬¹ØÓÚJava EE 5£¬ËäÈ»²»ÔõôºÃÌý£¬µ«¸è´ÊºÜÓÐÒâ˼£¬³ÌÐòÔ±ÒµÓàÉú»îÒ²¿ÉÒÔÕâô·á¸»£¬ÏÛĽ£¡
Ladies and gentlemen, this is Java EE 5!
One, two, three, four, five
There’s a technology I use day and night
For my application with a web frontend
They told me to use .Net
......
ѹËõÎļþ¼Ð´úÂ룺
import java.io.File;
import org.apache.tools.zip.ZipOutputStream; //Õâ¸ö°üÔÚant.jarÀҪµ½¹Ù·½ÍøÏÂÔØ
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.util.zip.ZipInputStream;
import java.util.zip.ZipEntry;
......