ÈçºÎÈ¡µÄJavaÔ´´úÂëÎļþÖÐÎļþÃûºÍÐкÅ
ÈçºÎÈ¡µÄJavaÔ´´úÂëÎļþÖÐÎļþÃûºÍÐкţº£©
ÔÚC/C++µÄ³ÌÐò£¬±àÒëÆ÷ÌṩÁËÁ½¸öºêÀ´Ö§³ÖÈ¡µÃÔ´ÎļþÖеÄÐкźÍÎļþÃû£¬ÕâÁ½¸öºêÊÇ__FILE__,__LINE__
Äã¿ÉÒÔÈçϵķ½·¨´òÓ¡ÐкźÍÎļþÃû
²é¿´Ô´´úÂë
´òÓ¡°ïÖú
1 #include <stdio.h>
2 int main()
3 {
4 fprintf(stdout,"[%s:%d] Hello World!",__FILE__,__LINE__);
5 return 0;
6 }
µ«ÊÇÔÚJAVAÏÂûÓÐÕâÁ½¸öºê£¬ÄÇôÎÒÃÇÈçºÎÀ´È¡µÃÎļþÃûºÍÐкţ¬·ÔÄJDK£¬ÎÒÃÇÕÒµ½StackTraceElementÕâ¸öÀà¡£Õâ¸öÀà¿ÉÒÔ´ÓThrowableÈ¡µÃ£¬ÁíÍâÒ²¿ÉÒÔ´ÓThreadÀàÈ¡µÃ£¬Í¨¹ýÕâЩÎÒдÈçϵÄÒ»¸ö´òÓ¡ÐкŵIJâÊÔ³ÌÐò£º
²é¿´Ô´´úÂë
´òÓ¡°ïÖú
01 public class LineNo {
02 public static int getLineNumber() {
03 return Thread.currentThread().getStackTrace()[2].getLineNumber();
04 }
05
06 public static String getFileName() {
07 return Thread.currentThread().getStackTrace()[2].getFileName();
08 }
09 public static void main(String args[]) {
10 System.out.println("["+getFileName()+"£º"+ getLineNumber()+"]"+"Hello World!");
11 }
12 }
ÁôÏÂÒ»¸öÎÊÌ⣬ÉÏÃæ³ÌÐòÖеÄmagicÊý×Ö 2 ´ú±íʲôº¬ÒåÄØ£¿
0ÊÇthread.getCurrentThread()
1ÊÇgetLineNumber()
2²ÅÊǵ÷ÓÃgetLineNumberµÄÀà
Ïà¹ØÎĵµ£º
Javaѧϰ´ÓÈëÃŵ½¾«Í¨
Ò»¡¢ JDK (Java Development Kit)
JDKÊÇÕû¸öJavaµÄºËÐÄ£¬°üÀ¨ÁËJavaÔËÐл·¾³£¨Java Runtime Envirnment£©£¬Ò»¶ÑJava¹¤¾ßºÍJava»ù´¡µÄÀà¿â(rt.jar)¡£²»ÂÛʲôJavaÓ¦Ó÷þÎñÆ÷ʵÖʶ¼ÊÇÄÚÖÃÁËij¸ö°æ±¾µÄJDK¡£Òò´ËÕÆÎÕJDKÊÇѧºÃJavaµÄµÚÒ»²½¡£×îÖ÷Á÷µÄJ ......
JAVAÀïµÄPINGÊÇÔÚJDK 1.5ºóÓÃÁËеĺ¯ÊýisreachableȥʵÏÖ,¾ßÌå½éÉÜÈçÏÂ:
InetAddress¶ÔÏóµÄ³£Ó÷½·¨
InetAddressÀàÓкܶà
get
·½·¨£¬ÓÃÀ´»ñÈ¡Ö÷»úÃû£¬Ö÷»úµØÖ·µÈÐÅÏ¢¡£Ö÷ÒªÓУº
byte[] getAddress() ·µ»Ø´Î
InetAddress
¶ÔÏóµÄÔʼ
IP
µØÖ·£¬±£´æΪһ¸ö
byte
Êý×é
String getCanonicalHostName() »ñÈ¡´Ë
I ......
¹ØÓÚJavaÕ»Óë¶ÑµÄ˼¿¼
1. Õ»(stack)Óë¶Ñ(heap)¶¼ÊÇJavaÓÃÀ´ÔÚRamÖдæ·ÅÊý¾ÝµÄµØ·½¡£ÓëC++²»Í¬£¬Java×Ô¶¯¹ÜÀíÕ»ºÍ¶Ñ£¬³ÌÐòÔ±²»ÄÜÖ±½ÓµØÉèÖÃÕ»»ò¶Ñ¡£
¡¡¡¡2. Õ»µÄÓÅÊÆÊÇ£¬´æÈ¡ËٶȱȶÑÒª¿ì£¬½ö´ÎÓÚÖ±½ÓλÓÚCPUÖеļĴæÆ÷¡£µ«È±µãÊÇ£¬´æÔÚÕ»ÖеÄÊý¾Ý´óСÓëÉú´æÆÚ±ØÐëÊÇÈ·¶¨µÄ£¬È±·¦Áé»îÐÔ¡£ÁíÍ⣬ջÊý¾Ý¿ÉÒÔ¹²Ïí£¬Ïê¼ûµÚ3µ ......
java¼¯ºÏ¿ò¼Üͼ¼°½éÉÜ
ת×Ô:http://hi.baidu.com/%C9%AE_%CC%C6/blog/item/9e2a8b0887008a8ad0581b3d.html
¼ò»¯Í¼£º
Javaƽ̨ÌṩÁËÒ»¸öȫеļ¯ºÏ¿ò¼Ü¡£“¼¯ºÏ¿ò¼Ü”Ö÷ÒªÓÉÒ»×éÓÃÀ´²Ù×÷¶ÔÏóµÄ½Ó¿Ú×é³É¡£²»Í¬½Ó¿ÚÃèÊöÒ»×鲻ͬÊý¾ÝÀàÐÍ¡£
Java 2¼¯ºÏ¿ò¼Üͼ
¼¯ºÏ½Ó¿Ú£º6¸ö½Ó¿Ú£¨¶ÌÐéÏß±íʾ£©£¬±íʾ²»Í ......
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 ......