java·´ÉäÖ®´´½¨ÊµÀý
ΪÁË×öµ½Ê¹µÃ³ÌÐò¾ßÓиü¸ßµÄÁé»îÐÔ£¬¿ÉÅäÖÃÐÔ£¬ÔÚ¿ª·¢ÖÐÎÒÃǾ³£ÀûÓ÷´ÉäÀ´´´½¨Ò»¸öÀàµÄʵÀý£¬Ò²¾ÍÊÇ»ñµÃÒ»¸öÀàµÄÒ»¸ö¶ÔÏó£¡Í¨³£µÄ×ö·¨ÊÇͨ¹ýclass.newInstance»ñµÃ£»µ«ÕâÖÖ·½·¨ÓÐÒ»¸ö²»ºÃµÄµØ·½£¬ÄǾÍÊÇËûÖ»ÄÜ´´½¨Î޲ι¹ÔìÆ÷µÄ¶ÔÏó£¬Èç¹û¹¹ÔìÆ÷ÓвÎÊýÄÇËüÊÇÎÞÄÜΪÁ¦µÄ£»½â¾öµÄ·½·¨¾ÍÊÇ ÏÈͨ¹ý¸ÃÀàµÄClass»ñµÃ´øÓвÎÊýµÄ¹¹ÔìÆ÷£¬È»ºóͨ¹ýµÃµ½µÄ¹¹ÔìÆ÷ºÍ´«ÈçµÄ³õʼ»¯²ÎÊýÀ´´´½¨ÊµÀý£¡ÒÔÏÂÊÇÉÏÊö×ö·¨µÄÒ»¸ödemo:
ʵÌåÀࣺ
package reflect;
public class Duck {
private Integer weight;
private String name;
public Duck(){
System.out.println("Î޲ε÷ÓÃÁË");
}
public Duck(String name){
name=name;
System.out.println("one²Îµ÷ÓÃÁË");
}
public Duck(String name,Integer weight){
name=name;
weight=weight;
System.out.println("Two²Îµ÷ÓÃÁË");
}
}
package reflect;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
public class ExeTest {
public static&nbs
Ïà¹ØÎĵµ£º
×î½ü¿´µ½ÂÛ̳ÀïÓиöÌû×ÓÔÚÌÖÂ۽ӿںͳéÏóÀàµÄÇø±ðºÍ×÷Óã¬ÕâÆäʵҲÊǺܶàÃæÊÔ¹Ùϲ»¶ÎʵÄÎÊÌ⣬ÕâÀïÎÒ¾Í˵˵ÎÒµÄ×ܽᣬ˳±ã˵˵ÄÚ²¿ÀàµÄ×÷Ó㬵±ÊǸø¸ÕÈëÃÅ£¬»òÕßÏëѧϰjavaµÄͬѧÃÇÄܸüºÃµÄÀí½âËüÃǵÄÓ÷¨¡£
1.½Ó¿Ú(interface)£¬½Ó¿Ú±»ÓÃÀ´½¨Á¢ÀàÓëÀàÖ®¼ä¹ØÁªµÄ±ê×¼¡£
Java code
public interface ITest{
public ......
1.ΪʲôҪʹÓÃÏ̳߳Ø
ÔÚjavaÖУ¬Èç¹ûÿ¸öÇëÇóµ½´ï¾Í´´½¨Ò»¸öÐÂỊ̈߳¬¿ªÏúÊÇÏ൱´óµÄ¡£ÔÚʵ¼ÊʹÓÃÖУ¬·þÎñÆ÷ÔÚ´´½¨ºÍÏú»ÙÏß³ÌÉÏ»¨·ÑµÄʱ¼äºÍÏûºÄµÄϵͳ×ÊÔ´¶¼Ï൱´ó£¬ÉõÖÁ¿ÉÄÜÒª±ÈÔÚ´¦Àíʵ¼ÊµÄÓû§ÇëÇóµÄʱ¼äºÍ×ÊÔ´Òª¶àµÄ¶à¡£³ýÁË´´½¨ºÍÏú»ÙÏ̵߳ĿªÏúÖ®Í⣬»î¶¯µÄÏß³ÌÒ²ÐèÒªÏûºÄϵͳ×ÊÔ´¡ ......
½ñÌìÒ»ÌìѧÁËÒì³£´¦ÀíÕâÒ»Õ¡£
Ê×ÏÈÒì³£ÊÇJava³ÌÐòÔÚÔËÐÐÆÚ³öÏֵĴíÎ󣬷DZàÒëÆÚ£¨javac£©³öÏֵĴíÎó¡£
È»ºóÔÙ¸øÒì³£·ÖÀ࣬Òì³£·ÖΪÈýÖÖ£¬µÚһΪerror£¬ÕâÖÖÒì³£²»¿ÉÒÔ´¦Àí£¬ÊÇϵͳµÄÄÚ²¿´íÎ󣬵ڶþΪException£¬ÕâÖÖ¿ÉÒÔ±»´¦Àí£¬ExceptionÀïÃæÓÖÓиöRuntimeExceptionµÄÀ࣬¶øRuntimeExceptionÓÖÊÇ¿ÉÒÔ²»±»²¶»ñ´¦ÀíµÄ£¬Òò ......
1.1 °²×°JDK
1.1.1 ÏÂÔØJDK
´ò¿ªhttp://java.sun.com/ÍøÕ¾£¬ÔÚĿ¼ÀïÃæÑ¡ÔñDownload£¬ÔÚÏÂÀ²Ëµ¥ÖÐÑ¡ÔñJava SE
½øÈëÏÂÒ»¸öÒ³Ã棬ҪѡÔñÏÂÔØJDK£¬¶ø²»ÒªÏÂÔØJRE£º
½ÓÏÂÀ´ÊÇÑ¡ÔñÔËÐеÄƽ̨£¬ÕâÀﵱȻÊÇÑ¡ÔñlinuxÁË£º
Ñ¡ÔñºÃƽ̨ºó£¬µã»÷continue:
ÕâÀï¿ÉÒÔÖ±½Óµ ......
ÔÚJavaÖУ¬²»Í¬µÄÀ඼ÓÐ×Ô¼ºµ¥¶ÀµÄCache»úÖÆ£¬ÊµÏֵķ½·¨Ò²¿ÉÄÜÓÐËù²»Í¬£¬ÎÄÕÂÁоÙÁËJavaÖг£¼ûµÄ¸÷ÀàCache»úÖƵÄʵÏÖ·½·¨£¬Í¬Ê±½øÐÐÁË×ۺϵıȽϡ£
OSCache
OSCacheÊǸöÒ»¸ö¹ã·º²ÉÓõĸßÐÔÄܵÄJava EE»º´æ¿ò¼Ü£¬OSCacheÄÜÓÃÓÚÈκÎJavaÓ¦ÓóÌÐòµÄÆÕͨµÄ»º´æ½â¾ö·½°¸¡£
OSCacheÓÐÒÔÏÂÌص㣺»º´æÈκζÔÏó£¬Äã¿ÉÒÔ²»ÊÜÏÞÖƵ ......