Java¶àÏ̵߳ÄÏà¹Ø»úÖÆ[z]
Ò» Ï̵߳Ļù±¾¸ÅÄî
Ïß³ÌÊÇÒ»¸ö³ÌÐòÄÚ²¿µÄ˳Ðò¿ØÖÆÁ÷.Ò»¸ö½ø³ÌÏ൱ÓÚÒ»¸öÈÎÎñ,Ò»¸öÏß³ÌÏ൱ÓÚÒ»¸öÈÎÎñÖеÄÒ»ÌõÖ´Ðз¾¶.£»¶à½ø³Ì:ÔÚ²Ù×÷ϵͳÖÐÄÜͬʱÔËÐжà¸öÈÎÎñ (³ÌÐò)£»¶àÏß³Ì:ÔÚͬһ¸öÓ¦ÓóÌÐòÖÐÓжà¸ö˳ÐòÁ÷ͬʱִÐУ»JavaµÄÏß³ÌÊÇͨ¹ýjava.lang.ThreadÀàÀ´ÊµÏֵģ»JVMÆô¶¯Ê±»áÓÐÒ»¸öÓÉÖ÷·½·¨(public static void main(){})Ëù¶¨ÒåµÄỊ̈߳»¿ÉÒÔͨ¹ý´´½¨ThreadµÄʵÀýÀ´´´½¨ÐµÄỊ̈߳»Ã¿¸öÏ̶߳¼ÊÇͨ¹ýij¸öÌض¨Thread¶ÔÏóËù¶ÔÓ¦µÄ·½·¨run()À´Íê³ÉÆä²Ù×÷µÄ,·½·¨run()³ÆΪÏß³ÌÌ壬ͨ¹ýµ÷ÓÃThreadÀàµÄstart()·½·¨À´Æô¶¯Ò»¸öÏ̡߳£
¶þ Ï̵߳Ĵ´½¨ºÍÆô¶¯
¿ÉÒÔÓÐÁ½ÖÖ·½Ê½´´½¨ÐµÄÏß³Ì:
µÚÒ»ÖÖ:
1.¶¨ÒåÏß³ÌÀàʵÏÖRunnable½Ó¿Ú
2.Thread myThread = new Thread(target); //targetΪRunnable½Ó¿ÚÀàÐÍ
3.RunnableÖÐÖ»ÓÐÒ»¸ö·½·¨:public void run();ÓÃÒÔ¶¨ÒåÏß³ÌÔËÐÐÌå
4.ʹÓÃRunnable½Ó¿Ú¿ÉÒÔΪ¶à¸öÏß³ÌÌṩ¹²ÏíµÄÊý¾Ý
5.ÔÚʵÏÖRunnable½Ó¿ÚµÄÀàµÄrun()·½·¨¶¨ÒåÖпÉÒÔʹÓÃThreadµÄ¾²Ì¬·½·¨public static Thread currentThread();»ñÈ¡µ±Ç°Ï̵߳ÄÒýÓÃ
µÚ¶þÖÖ:
1.¿ÉÒÔ¶¨ÒåÒ»¸öThreadµÄ×ÓÀಢÖØдÆärun·½·¨Èç:
class MyThread extends Thread {
public void run() {...}
}
2.È»ºóÉú³É¸ÃÀàµÄ¶ÔÏó:
MyThread myThread = new MyThread();
Èý Ï߳̿ØÖƵĻù±¾·½·¨
isAlive():ÅжÏÏß³ÌÊÇ·ñ»¹"»î"×Å
getPriority():»ñµÃÏ̵߳ÄÓÅÏȼ¶ÊýÖµ
setPriority():ÉèÖÃÏ̵߳ÄÓÅÏȼ¶ÊýÖµ
Thread.sleep():½«µ±Ç°Ïß³Ì˯ÃßÖ¸¶¨ºÁÃëÊý
join():µ÷ÓÃijÏ̵߳ĸ÷½·¨,½«µ±Ç°Ïß³ÌÓë¸ÃÏß³Ì"ºÏ²¢",¼´µÈ´ý¸ÃÏ߳̽áÊø,ÔÙ»Ö¸´µ±Ç°Ï̵߳ÄÔËÐÐ
yield():Èóöcpu,µ±Ç°Ï߳̽øÈë¾ÍÐ÷¶ÓÁеȴýµ÷¶È
wait():µ±Ç°Ï߳̽øÈë¶ÔÏóµÄwait pool
notify()/notifyAll():»½ÐѶÔÏóµÄwait poolÖеÄÒ»¸ö/ËùÓеȴýÏß³Ì
Ò» Ï̵߳Ļù±¾¸ÅÄî
Ïß³ÌÊÇÒ»¸ö³ÌÐòÄÚ²¿µÄ˳Ðò¿ØÖÆÁ÷.Ò»¸ö½ø³ÌÏ൱ÓÚÒ»¸öÈÎÎñ,Ò»¸öÏß³ÌÏ൱ÓÚÒ»¸öÈÎÎñÖеÄÒ»ÌõÖ´Ðз¾¶.£»¶à½ø³Ì:ÔÚ²Ù×÷ϵͳÖÐÄÜͬʱÔËÐжà¸öÈÎÎñ (³ÌÐò)£»¶àÏß³Ì:ÔÚͬһ¸öÓ¦ÓóÌÐòÖÐÓжà¸ö˳ÐòÁ÷ͬʱִÐУ»JavaµÄÏß³ÌÊÇͨ¹ýjava.lang.ThreadÀàÀ´ÊµÏֵģ»JVMÆô¶¯Ê±»áÓÐÒ»¸öÓÉÖ÷·½·¨(public static void main(){})Ëù¶¨ÒåµÄỊ̈߳»¿ÉÒÔͨ¹ý´´½¨ThreadµÄʵÀýÀ´´´½¨ÐµÄỊ̈߳»Ã¿¸öÏ̶߳¼ÊÇͨ¹ýij¸öÌض¨Thread¶ÔÏóËù¶ÔÓ¦µÄ·½·¨run()À´Íê³ÉÆä²Ù×÷µÄ,·½·¨run()³ÆΪÏß³ÌÌ壬ͨ¹ýµ÷ÓÃThreadÀàµÄstart()·½·¨À´Æô¶¯Ò»¸öÏ̡߳£
¶
Ïà¹ØÎĵµ£º
1£® »ù±¾¿â
cxf-2.2.4.jar
XmlSchema-1.4.5.jar
Wsdl4j-1.6.2.java
2£® ÔÚ.NETÖбàд·þÎñ£¬Ä¬ÈϲÎÊý¼´¿É£¬È磺
namespace TestService2Java
{
[WebService(Namespace = "http://temp2java.org/")] //½ö´Ë´¦ÉÔ¼ÓÐ޸ģ¬²»¸ÄÒ²¿É
[WebServiceBin ......
ÈçºÎÈ¡µÄJavaÔ´´úÂëÎļþÖÐÎļþÃûºÍÐкţº£©
ÔÚC/C++µÄ³ÌÐò£¬±àÒëÆ÷ÌṩÁËÁ½¸öºêÀ´Ö§³ÖÈ¡µÃÔ´ÎļþÖеÄÐкźÍÎļþÃû£¬ÕâÁ½¸öºêÊÇ__FILE__,__LINE__
Äã¿ÉÒÔÈçϵķ½·¨´òÓ¡ÐкźÍÎļþÃû
²é¿´Ô´´úÂë
´òÓ¡°ïÖú
1 #include <stdio.h>
2 int main()
3 {
4&nbs ......
×ܹ²Á½¸öÎļþTaxTest.javaÓëTax.java
---------------------------------------------------------------------------------------
TaxTest.java
===========================================
import javax.swing.JOptionPane;
public class TestTax{
public static void main(String[] args){
String yea ......
µÚÒ»½Ú Êý¾ÝÁ÷µÄ»ù±¾¸ÅÄî
Àí½âÊý¾ÝÁ÷
Á÷Ò»°ã·ÖΪÊäÈëÁ÷£¨Input Stream£©ºÍÊä³öÁ÷£¨Output Stream£©Á½À࣬µ«ÕâÖÖ»®·Ö²¢²»ÊǾø¶ÔµÄ¡£±ÈÈçÒ»¸öÎļþ£¬µ±ÏòÆäÖÐдÊý¾Ýʱ£¬Ëü¾ÍÊÇÒ»¸öÊä³öÁ÷£»µ±´ÓÆäÖжÁÈ¡Êý¾Ýʱ£¬Ëü¾ÍÊÇÒ»¸öÊäÈëÁ÷¡£µ±È»£¬¼üÅÌÖ»ÊÇÒ»¸öÊýÈËÁ÷£¬¶øÆÁÄ»ÔòÖ»ÊÇÒ»¸öÊä³öÁ÷¡ ......
ÔÚÕâÀï½éÉÜÁ½ÖÖ·½·¨Éú³Éjar£¬µÚÒ»ÖÖÊÇÓÃEclpiseµÄExport¹¦ÄÜ¡£ÔÚÒª´ò°üµÄÏîÄ¿ÉÏ»÷ÓÒ¼ü£¬Ñ¡ÔñExport£¬ÔÚ´°¿ÚÖÐÑ¡ÔñJavaÀïµÄJAR file¡£NextºóµÄ´°¿ÚÖÐÒѾ×Ô¶¯Ñ¡ºÃÁËÒª´ò°üµÄÏîÄ¿£¬Óû§¿ÉÒÔµã»÷¼ÓºÅ²é¿´ÏîÄ¿Àï±»´ò°üµÄÄÚÈÝ¡£ÔÚÏÂÃæµÄJAR fileÀïÉèÖÃÄã´ò°üÉú³ÉjarÎļþµÄÊä³öĿ¼£¬ÏÂÒ»²½ÔÚ³öÏֵĴ°¿ÚÖÐÑ¡ÔñUse existin ......