javaÖÐthisºÍsuperµÄÓ÷¨
thisµÄÓ÷¨ÔÚjavaÖдóÌå¿ÉÒÔ·ÖΪ3ÖÖ£º
//1.ÆÕͨµÄÖ±½ÓÒýÓÃ
class test {
private int x,y;
public test(int x,int y) {
setX(x);//Ò²¿ÉÒÔдΪthis.setX(x);ÕâÖÖÇé¿öÏÂthis¿ÉÒÔÊ¡ÂÔ.
}
}
//2.·½·¨ÖеÄij¸öÐβÎÃûÓ뵱ǰ¶ÔÏóµÄij¸ö³ÉÔ±ÓÐÏàͬµÄÃû×Ö.ΪÁ˲»»ìÏý,ʹÓÃthisÇø·ÖÓÐthisÒýÓõÄÊdzÉÔ±,ûÓÐthisÊÇÐβÎ
class test {
private int x,y;
public test(int x,int y) {
setX(x);//Ò²¿ÉÒÔдΪthis.setX(x);ÕâÖÖÇé¿öÏÂthis¿ÉÒÔÊ¡ÂÔ.
}
setX(int x){
this.x = x;//this.xÊÇÒýÓõĶÔÏó,xÊÇsetX(int x)ÖеÄÐвÎx
}
}
//3.ÒýÓù¹Ô캯Êý
class test.{
public int x,y;
public test(int x,int y){
this.x = x;
this.y = y;
}
public test(){
this.(2,0)//¹¹Ô캯Êýµ÷ÓÃÆäËû¹¹Ô캯ÊýµÄ·½·¨,Õâ¸öÀý×Óµ÷ÓÃÉÏÃæÄǸö¸´Óù¹Ô캯ÊýµÄ·½·¨
}
}
package test;
public class ThisTest {
private int i=0;
//µÚÒ»¸ö¹¹ÔìÆ÷£ºÓÐÒ»¸öintÐÍÐβÎ
ThisTest(int i){
this.i=i+1;//´Ëʱthis±íʾÒýÓóÉÔ±±äÁ¿£é£¬¶ø·Çº¯Êý²ÎÊý£é
System.out.println("Int constructor i——this.i: "+i+"——"+this.i);
System.out.println("i-1:"+(i-1)+"this.i+1:"+(this.i+1));
//´ÓÁ½¸öÊä³ö½á¹û³ä·ÖÖ¤Ã÷ÁËiºÍthis.iÊDz»Ò»ÑùµÄ£¡
}
// µÚ¶þ¸ö¹¹ÔìÆ÷£ºÓÐÒ»¸öStringÐÍÐβÎ
ThisTest(String s){
System.out.println("String constructor: "+s);
}
Ïà¹ØÎĵµ£º
http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp
Categories of Java HotSpot VM Options
Standard options recognized by the Java HotSpot VM are described on the Java Application Launcher reference pages for Windows
, Solaris
and Linux
. This document deals exclusively wit ......
ÏÖÔÚUrlRewriter¼¼ÊõÓÐÁ½¸ö¼¼Êõƽ̨µÄ£¬Ò»¸ö¾ÍÊÇÔÚJava·½ÏòµÄ£¬ÁíÒ»¸ö¾ÍÊÇ.NET·½ÏòµÄ¡£Õâ´ÎÊÇJava·½ÏòµÄÓ¦Óá£
Ê×ÏÈÈÃÎÒÃÇÁ˽âËüµÄ¹¤×÷ÔÀí£¬Ëµ°×ÁËËü¾ÍÊÇÒ»¸ö¼òµ¥µÄ¹ýÂËÆ÷£¨Filter£©£¬¿´¿´Ô´ÂëÄã¾Í»áºÜ¿ìµÄÃ÷°×£¬Ëü¾ÍÊÇͨ¹ýÎÒÃÇÔÚjspÖг£ÓõÄÁ½¸ö·½·¨ÊµÏÖµÄforward(),sendRedirect().
ÏÂÃæÎÒÃǾͿìËÙµÄΪÄãµÄÍøÕ¾´î½¨U ......
תÌù£ºhttp://lvp.javaeye.com/blog/356650
1.ÈçºÎÀí½âException,ErrorºÍThrowable
ThrowableÊÇExceptionºÍErrorµÄ¸¸Àà.
Error±íʾ´íÎó£¬Ò»°ãÊÇϵͳ¼¶µÄ´íÎó£¡
ExceptionÒ»°ãÊdzÌÐòÔËÐÐÆÚ¼äµÄ´íÎó£¡
ͨ³ ......
ǰÑÔ£ºÇ°¶Îʱ¼äÔÚCSDNµÄC++ÉçÇøÓöµ½Ò»¸öÐèÒª·â×°¿¼ÇÚ»ú½Ó¿ÚµÄ¶¯Ì¬¿â¸øJAVAµ÷ÓõÄÌû×Ó£¬¹´ÆðÁËÎÒ¶ÔJAVAµÄÎÞÏÞ»³Äî¡£ÔÚ´Ë£¬ÎÒÏë°ÑÕâÏî¼¼Êõ¼òµ¥ÔÙ½éÉÜһϡ£
Ò»¡¢¹ØÓÚJava Native Interface (JNI)
JNIÊÇJAVA±¾µØ±à³Ì½Ó¿Ú£¬ÊôÓÚJDKµÄÒ»²¿·Ö¡£ËüÔÊÐíJAVAÄܹ»²Ù×÷±¾µØAPI»òÓÉÆäËûÓïÑÔ±àдµÄ¶¯Ì¬¿â¡£²»¹ýµ±ÄãʹÓÃÕâÏî¼¼ÊõµÄʱºò£ ......
java»ñÈ¡µ±Ç°Â·¾¶[ת]
¹Ø¼ü×Ö: java ·¾¶
java »ñÈ¡µ±Ç°Â·¾¶
1 ¡¢ÀûÓà System.getProperty() º¯Êý»ñÈ¡µ±Ç°Â·¾¶£º
System.out.println(System.getProperty("user.dir"));//user.dir Ö¸¶¨Á˵±Ç°µÄ·¾¶
2 ¡¢Ê¹Óà File ÌṩµÄº¯Êý»ñÈ¡µ±Ç°Â·¾¶£º
File directory = new File("");// É趨Ϊµ±Ç°Îļþ ......