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

JavaµÄһЩ»ã×Ü

1.//propertyÎļþµÄ¶ÁÈ¡
//com.test.messageÎļþ
package com.test;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
public class Test_Messages {
private static final String BUNDLE_NAME = "com.test.messages";
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
.getBundle(BUNDLE_NAME);
private Batch_Messages() {
}
public static String getString(String key) {
try {
return RESOURCE_BUNDLE.getString(key);
} catch (MissingResourceException e) {
return '!' + key + '!';
}
}

2.JavaÅú´¦Àíµ÷ÓÃ
Process process;
try {
process = Runtime.getRuntime().exec("D://test.bat");
BufferedReader read = new BufferedReader(new InputStreamReader(
process.getInputStream()));
String str = null;
while((str = read.readLine())!=null) {
System.err.println(str);
}
} catch(Exception e){
e.printStackTrace();

3.tomcat·þÎñÆ÷¶Ë¿Ú¸ü¸Ä·½·¨£º
ÓÉÓÚtomcat·þÎñÆ÷µÄȱʡ·þÎñ¶Ë¿ÚΪ8080£¬ËùÒÔΪÁ˳ɹ¦ÔËÐÐtomcat·þÎñÆ÷Ò»¶¨ÒªÈ·±£8080¶Ë¿ÚûÓб»ÆäËüÈí¼þÕ¼Óá£
Èç¹ûÒѾ­±»Õ¼Óã¬ÎÒÃÇÐèÒª¸Ä±ätomcat·þÎñÆ÷µÄ·þÎñ¶Ë¿Ú£¬¾ßÌå²½ÖèÈçÏ£º
   ´ò¿ªtomcat·þÎñÆ÷¸ù·¾¶ÏÂconfĿ¼ÏµÄserver.xmlÎļþ£¬ÕÒµ½ÈçÏÂÅäÖñêÇ©£º
   <Connector port="8080" protocol="HTTP/1.1" 
                     maxThreads="150" connectionTimeout="20000" redirectPort="8443" />
   ½«8080¸ÄΪÆäËüµÄ¶Ë¿Ú£¬±ÈÈç8088£¬Õâʱ¿Í»§¶Ë·ÃÎʵÄ·¾¶Ó¦¸ÃΪhttp://localhost:8088


Ïà¹ØÎĵµ£º

¹ØÓÚJava½Ó¿ÚºÍ³éÏóÀàµÄ˼¿¼

Java ½Ó¿ÚºÍ³éÏóÀàÇø±ð ÊÕ²Ø
À´Ô´ http://blog.csdn.net/sunboard/archive/2009/01/18/3831823.aspx
Ò»¸öÈí¼þÉè¼ÆµÄºÃ»µ£¬ÎÒÏëºÜ´ó³Ì¶ÈÉÏÈ¡¾öÓÚËüµÄÕûÌå¼Ü¹¹£¬¶øÕâ¸öÕûÌå¼Ü¹¹Æäʵ¾ÍÊÇÄã¶ÔÕû¸öºê¹ÛÉÌÒµÒµÎñµÄ³éÏó¿ò¼Ü£¬µ±´ú±íÒµÎñÂß¼­µÄ¸ß²ã³éÏó²ã½á¹¹ ºÏÀíʱ£¬Äãµ×²ãµÄ¾ßÌåʵÏÖÐèÒª¿¼Âǵľͽö½öÊÇһЩËã·¨ºÍһЩ¾ßÌåµÄÒµ ......

java×Ö·û´®µÄ¸÷ÖÖ±àÂëת»»

import java.io.UnsupportedEncodingException;
/**
* ת»»×Ö·û´®µÄ±àÂë
*/
public class ChangeCharset {
/** 7λASCII×Ö·û£¬Ò²½Ð×÷ISO646-US¡¢Unicode×Ö·û¼¯µÄ»ù±¾À­¶¡¿é */
public static final String US_ASCII = "US-ASCII";
/** ISO À­¶¡×Öĸ±í No.1£¬Ò²½Ð×÷ ISO-LATIN-1 */
public static final String ISO_ ......

javaÖеİü

1.ÉùÃ÷°ü£ºpackage °üÃû
               ¸ÃÓï¾äÊÇ×÷ΪjavaÔ´ÎļþµÄµÚÒ»ÌõÓï¾ä  Ö¸Ã÷¸ÃÔ´Îļþ¶¨ÒåµÄÀàËùÔڵİü
2.µ¼°ü£ºimport °üÃû
            ¸ÃÓï¾ä±ØÐëдÔÚpackageÓï¾äºÍÔ´Îļ ......

JavaÖÐÈÃCPU±£³ÖÔÚÒ»ÌõÖ±ÏßÉÏ


 /**
  * @param args
  */
 public static void main(String[] args) {
  long time1 = System.currentTimeMillis();
  long time2 = System.currentTimeMillis();
  while (true) {
   while ((time1 - time2) < 30)
   & ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ