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

javaϵͳ¼à¿ØCPU ´ÅÅÌ


import java.io.*;   
  
/**
* linux ÏÂcpu ÄÚ´æ ´ÅÅÌ jvmµÄʹÓüà¿Ø
* @author avery_leo
*
*/  
public class TT {   
    /**
      * »ñÈ¡cpuʹÓÃÇé¿ö
      * @return
      * @throws Exception
      */  
    public double getCpuUsage() throws Exception {   
        double cpuUsed = 0;   
  
         Runtime rt = Runtime.getRuntime();   
         Process p = rt.exec("top -b -n 1");// µ÷ÓÃϵͳµÄ“top"ÃüÁî   
       
  
         BufferedReader in = null;   
        try {   
             in = new BufferedReader(new InputStreamReader(p.getInputStream()));   
             String str = null;   
             String[] strArray = null;   
           
            while ((str = in.readLine()) != null) {   
                int m = 0;   
                   
                if (str.indexOf(" R ") != -1) {// Ö»·ÖÎöÕýÔÚÔËÐеĽø³Ì£¬top½ø³Ì±¾Éí³ýÍâ &&am


Ïà¹ØÎĵµ£º

Java½â¶ÁÄڴ棬ÓÅ»¯±à³Ì

      Ò».´úÂëÓÅ»¯
¡¡¡¡ÄÚ´æ»áÒç³ö¿Ï¶¨ºÍ´úÂëÌÓ²»Á˹Øϵ,99.99%ѧjavaµÄÈ˶¼ÖªµÀÀ¬»ø»ØÊÕÆ÷ÊÇ javaµÄÒ»´óÓŵ㲢¾Ý´ËÀ´³°Ð¦C++¡£ÏÔÈ»Õâ¸öÌØÐÔΪ´úÂë±àдÕßÊ¡Á˲»ÉÙÊ£¬µ«Õâ¸öÌØÐÔÈ´´øÀ´Á˲»ÉÙÒþ»¼¡£¾Ù¸öÀý×ÓÔÚÓÎÏ·µ±Öо­³£Óв»Í¬³¡¾°µÄÇл»£¬Èç´ÓÓÎÏ·Âß¼­Í˵½Ö÷²Ëµ¥Âß¼­,¶ÔÓÎÏ·Âß¼­¶ÔÏóµÄ̬¶ ......

JAVA¶ÁÊé±Ê¼Ç£¨¶þ£©

²Ù×÷·û
1.λ²Ù×÷·û
(a) >>>ÓÒÒÆ£¬¸ßλÓÃ0Ìî³ä£»
int a = 14;
int b = 2;
System.out.println(a >>> b);// 3
int c = -14;
int d = 2;
System.out.println(c >>> d);// 1073741820
(b) >>·ûºÅλ²»±ä£¬ÆäËûλÓÒÒÆ£¬¸ßλÓÃ0Ìî³ä£¬Æä½á¹ûÓëa/2bÏàͬ£»
int a = 14;
int b = 2;
Sy ......

javaÖÐËÄÖÖ²Ù×÷xml·½Ê½µÄ±È½Ï

   1£©DOM£¨JAXP Crimson½âÎöÆ÷£©
    DOMÊÇÓÃÓëƽ̨ºÍÓïÑÔÎ޹صķ½Ê½±íʾXMLÎĵµµÄ¹Ù·½W3C±ê×¼¡£DOMÊÇÒÔ²ã´Î½á¹¹×éÖ¯µÄ½Úµã»òÐÅϢƬ¶ÏµÄ¼¯ºÏ¡£Õâ¸ö²ã´Î½á¹¹ÔÊÐí¿ª·¢ÈËÔ±ÔÚÊ÷ÖÐÑ°ÕÒÌض¨ÐÅÏ¢¡£·ÖÎö¸Ã½á¹¹Í¨³£ÐèÒª¼ÓÔØÕû¸öÎĵµºÍ¹¹Ôì²ã´Î½á¹¹£¬È»ºó²ÅÄÜ×öÈκι¤×÷¡£ÓÉÓÚËüÊÇ»ùÓÚÐÅÏ¢²ã´ÎµÄ£¬Òò¶øDO ......

javaMail java·¢ËÍemail

·¢ËÍemailÓ¦Óã»
package mail;
import java.util.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;
import sun.misc.BASE64Encoder;
public class Mail {
 // ¶¨Òå·¢¼þÈËÏÔʾÃû³Æ¡¢·¢¼þÈË¡¢ÊÕ¼þÈË¡¢³­ËÍ¡¢SMTP·þÎñÆ÷¡¢Óû§Ãû¡¢ÃÜÂë¡¢Ö÷Ìâ¡¢ÄÚÈݵÈ
 private String d ......

javaѧϰ ÎļþIOÁ÷

   
ÏëÅúÁ¿ÐÞ¸ÄÒ»¸öÎļþ¼ÐµÄËùÓÐÎļþµÄÎļþÃû£¬ÔÚÍøÉÏÕÒÁ˺öàÈí¼þ¶¼²»ºÃÓã¬ÃÍÈ»ÏëÆðÀ´ÎÒ×Ô¼ºÒ²»áд´úÂëô~~~
Õâ¸ö´úÂëÖ»ÄÜ×Ô¶¨ÒåÀ©Õ¹Ãû¡£¡£ÎļþÃûĬÈÏÊÇ0£¬ÒÔºó¾Í++À²£¬Ò²¾ÍÊÇ1£¬2£¬3……Ö»ÊÇ»ù´¡ÐÔ´úÂë
import java.io.File;
public class Rename {
 /**
  * @param args
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ