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

ÉîÈëdz³öJava¶àÏ̳߳ÌÐòÉè¼Æ

Ò»£ºÀí½âJava¶àÏß³Ì
¶àÏß³ÌÊÇÕâÑùÒ»ÖÖ»úÖÆ£¬ËüÔÊÐíÔÚ³ÌÐòÖв¢·¢Ö´Ðжà¸öÖ¸ÁîÁ÷£¬Ã¿¸öÖ¸ÁîÁ÷¶¼³ÆΪһ¸öỊ̈߳¬±Ë´Ë¼ä»¥Ïà¶ÀÁ¢¡£Ïß³ÌÓÖ³ÆΪÇáÁ¿¼¶½ø³Ì£¬ËüºÍ½ø³ÌÒ»ÑùÓµÓжÀÁ¢µÄÖ´ÐпØÖÆ£¬ÓɲÙ×÷ϵͳ¸ºÔðµ÷¶È£¬Çø±ðÔÚÓÚÏß³ÌûÓжÀÁ¢µÄ´æ´¢¿Õ¼ä£¬¶øÊǺÍËùÊô½ø³ÌÖеÄÆäËüÏ̹߳²ÏíÒ»¸ö´æ´¢¿Õ¼ä£¬ÕâʹµÃÏ̼߳äµÄͨÐÅÔ¶½Ï½ø³Ì¼òµ¥¡£
¶à¸öÏ̵߳ÄÖ´ÐÐÊDz¢·¢µÄ£¬Ò²¾ÍÊÇÔÚÂß¼­Éϓͬʱ”£¬¶ø²»¹ÜÊÇ·ñÊÇÎïÀíÉϵēͬʱ”¡£Èç¹ûϵͳֻÓÐÒ»¸öCPU£¬ÄÇôÕæÕýµÄ“ͬʱ”ÊDz»¿ÉÄܵģ¬µ«ÊÇÓÉÓÚCPUµÄËٶȷdz£¿ì£¬Óû§¸Ð¾õ²»µ½ÆäÖеÄÇø±ð£¬Òò´ËÎÒÃÇÒ²²»ÓùØÐÄËü£¬Ö»ÐèÒªÉèÏë¸÷¸öÏß³ÌÊÇͬʱִÐм´¿É¡£
¶àÏ̺߳ʹ«Í³µÄµ¥Ïß³ÌÔÚ³ÌÐòÉè¼ÆÉÏ×î´óµÄÇø±ðÔÚÓÚ£¬ÓÉÓÚ¸÷¸öÏ̵߳ĿØÖÆÁ÷±Ë´Ë¶ÀÁ¢£¬Ê¹µÃ¸÷¸öÏß³ÌÖ®¼äµÄ´úÂëÊÇÂÒÐòÖ´Ðеģ¬ÓÉ´Ë´øÀ´µÄÏ̵߳÷¶È£¬Í¬²½µÈÎÊÌ⣬½«ÔÚÒÔºó̽ÌÖ¡£
¶þ£ºÊµÏÖJava¶àÏß³Ì
ÎÒÃDz»·ÁÉèÏ룬ΪÁË´´½¨Ò»¸öеÄỊ̈߳¬ÎÒÃÇÐèÒª×öЩʲô£¿ºÜÏÔÈ»£¬ÎÒÃDZØÐëÖ¸Ã÷Õâ¸öÏß³ÌËùÒªÖ´ÐеĴúÂ룬¶øÕâ¾ÍÊÇÔÚJavaÖÐʵÏÖ¶àÏß³ÌÎÒÃÇËùÐèÒª×öµÄÒ»ÇУ¡
ÕæÊÇÉñÆ棡JavaÊÇÈçºÎ×öµ½ÕâÒ»µãµÄ£¿Í¨¹ýÀ࣡×÷Ϊһ¸öÍêÈ«ÃæÏò¶ÔÏóµÄÓïÑÔ£¬JavaÌṩÁËÀà java.lang.Thread À´·½±ã¶àÏ̱߳à³Ì£¬Õâ¸öÀàÌṩÁË´óÁ¿µÄ·½·¨À´·½±ãÎÒÃÇ¿ØÖÆ×Ô¼ºµÄ¸÷¸öỊ̈߳¬ÎÒÃÇÒÔºóµÄÌÖÂÛ¶¼½«Î§ÈÆÕâ¸öÀà½øÐС£
ÄÇôÈçºÎÌṩ¸ø Java ÎÒÃÇÒªÏß³ÌÖ´ÐеĴúÂëÄØ£¿ÈÃÎÒÃÇÀ´¿´Ò»¿´ Thread Àà¡£Thread Àà×îÖØÒªµÄ·½·¨ÊÇ run() £¬ËüΪThread ÀàµÄ·½·¨ start() Ëùµ÷Óã¬ÌṩÎÒÃǵÄÏß³ÌËùÒªÖ´ÐеĴúÂ롣ΪÁËÖ¸¶¨ÎÒÃÇ×Ô¼ºµÄ´úÂ룬ֻÐèÒª¸²¸ÇËü£¡
·½·¨Ò»£º¼Ì³Ð Thread Àà
¸²¸Ç·½·¨ run()£¬ÎÒÃÇÔÚ´´½¨µÄ Thread ÀàµÄ×ÓÀàÖÐÖØд run() ,¼ÓÈëÏß³ÌËùÒªÖ´ÐеĴúÂë¼´¿É¡£ÏÂÃæÊÇÒ»¸öÀý×Ó£º
public class MyThread extends Thread {
¡¡int count= 1, number;
¡¡public MyThread(int num) {
number = num;
System.out.println("´´½¨Ïß³Ì " + number);
¡¡}
¡¡public void run() {
while(true) {
¡¡System.out.println("Ïß³Ì " + number + ":¼ÆÊý " + count);
¡¡if(++count== 6) return;
}     
¡¡}      
¡¡public static void main(String args[]) {
for(int i = 0; i < 5; i++) new MyThread(i+1).start();
¡¡}     
}
ÕâÖÖ·½·¨¼òµ¥Ã÷ÁË£¬·ûºÏ´ó¼ÒµÄÏ°¹ß£¬µ«ÊÇ£¬ËüÒ²ÓÐÒ»¸öºÜ´óµÄȱµã£¬ÄǾÍÊÇÈç¹ûÎÒÃǵÄÀàÒѾ­´


Ïà¹ØÎĵµ£º

java²¢·¢±à³Ìʵ¼ù±Ê¼Ç

  1, ±£Ö¤Ḭ̈߳²È«µÄÈýÖÖ·½·¨: a, ²»Òª¿çÏ̷߳ÃÎʹ²Ïí±äÁ¿b, ʹ¹²Ïí±äÁ¿ÊÇfinalÀàÐ͵Äc, ½«¹²Ïí±äÁ¿µÄ²Ù×÷¼ÓÉÏͬ²½
    2, Ò»¿ªÊ¼¾Í½«ÀàÉè¼Æ³ÉḬ̈߳²È«µÄ, ±ÈÔÚºóÆÚÖØÐÂÐÞ¸´Ëü,¸üÈÝÒ×.
    3, ±àд¶àÏ̳߳ÌÐò, Ê×Ïȱ£Ö¤ËüÊÇÕýÈ·µÄ, Æä´ÎÔÙ¿¼ÂÇÐÔÄÜ.
    4, ÎÞ ......

javaÖÐÊäÈëÊä³ö×ܽá

µÚÒ»½Ú Êý¾ÝÁ÷µÄ»ù±¾¸ÅÄî
      Àí½âÊý¾ÝÁ÷
Á÷Ò»°ã·ÖΪÊäÈëÁ÷£¨Input Stream£©ºÍÊä³öÁ÷£¨Output Stream£©Á½À࣬µ«ÕâÖÖ»®·Ö²¢²»ÊǾø¶ÔµÄ¡£±ÈÈçÒ»¸öÎļþ£¬µ±ÏòÆäÖÐдÊý¾Ýʱ£¬Ëü¾ÍÊÇÒ»¸öÊä³öÁ÷£»µ±´ÓÆäÖжÁÈ¡Êý¾Ýʱ£¬Ëü¾ÍÊÇÒ»¸öÊäÈëÁ÷¡£µ±È»£¬¼üÅÌÖ»ÊÇÒ»¸öÊýÈËÁ÷£¬¶øÆÁÄ»ÔòÖ»ÊÇÒ»¸öÊä³öÁ÷¡ ......

JavaÖÐStringµÄÓ÷¨×ܽá

 ¹¹Ôì·½·¨£º
String()
          ³õʼ»¯Ò»¸öд´½¨µÄ String ¶ÔÏó£¬Ëü±íʾһ¸ö¿Õ×Ö·ûÐòÁС£
String(byte[] bytes)
          ¹¹ÔìÒ»¸öÐ嵀 String£¬·½·¨ÊÇʹÓÃƽ̨µÄĬÈÏ×Ö·û¼¯½âÂë×Ö½ÚµÄÖ¸¶¨Êý×é¡£
String(byte ......

java nio Ö®MappedByteBuffer

 
ÆäʵÕÆÎÕ
MappedByteBuffer
²¢²»ÄÑ£¬Ö»Òª¼Çס“Èý·½Èý·¨ÈýÌØÐÔ”£¨ÎÒ×Ô¼º×ܽáµÄ£¬ºÇºÇ
~~
²»ÒªÈÓ¼¦µ°Å¶¡£¡£¡££©Õâ¾ä»°¾Í¿ÉÒÔÇáËɸ㶨£¡
MappedByteBuffer
Ö»ÊÇÒ»ÖÖÌØÊâµÄ
ByteBuffer
£¬¼´ÊÇ
ByteBuffer
µÄ×ÓÀà¡£
MappedByteBuffer
½«ÎļþÖ±½ÓÓ³Éäµ½Äڴ棨ÕâÀïµÄÄÚ´æÖ¸µÄÊÇÐéÄâÄڴ棬²¢² ......

PoC TBCPÏûÏ¢½âÎöºÍ¹¹ÔìµÄJAVAʵÏÖ

TBCPMessageFactory.java
/**
* ÎļþÃû: TBCPMessageFactory.java
*/
package tbcpstack;
import java.text.MessageFormat;
import org.apache.log4j.Logger;
import TBCPException;
/**
*
* TODO TBCPÏûÏ¢¹¹½¨¹¤³§
*/
public class TBCPMessageFactory {
/**
* Logger for this class
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ