- P]
JavaPԇ֪Rc\
JavaṩObject^PϵͬһõĘObjectObjectʹõСռJavaPԇ֪RcϣJx!
1.@ClassNʽ
// 1. o@ d
String classname = "cn.itcast.reflect.Person";// ļ
Class clazz = Class.forName(classname);// ˌPerson.class
// 2. õˌ֪ʲô ګ@Ì
Object obj = new Person();
Class clazz1 = obj.getClass();// @Ìw
// 3. _ث@ijClass Ҫڂ
Class clazz2 = Person.class;
һJavaĎNʽ
(1) newZ䄓@ҊĄķ
(2) \÷ֶ,{java.lang.Classjava.lang.reflect.ConstructornewInstance()
(3) {Ìclone()
(4) \÷лֶ{java.io.ObjectInputStream readObject()
(1)(2)_@ʽ{Ø캯 ;(3)ڃȴόЌӰӡԲ{Ø캯 ;(4)Ǐļ߀ԭČҲ{Ø캯
2.Java׃Ϸ
$ ĸ_^Ŀǔĸ;Ԕ_^JavaPI
3.
abstractstaticnativesynchronized
nativeطoϵyȥFJNI{Õrʹ
4.oB׃Main
Mainпֱʹstatic׃ֱʹ÷oB׃ʹ÷oB׃Ҫnewʹ
oB{÷oBķ׃(ѽڵĖ|߀ڵĖ|);oBֱ{oB׃ҽoxֵڷoBжxoB׃;
5.L(ⲿ)
(1)publicԱL(all)
(2)privateֻܱԼL
(3)protectedͬһL
(4)default(ĬJ)ͬһеLr]мJfriendly
6.Java^еĘ췽
(1)Ę^б{Ę췽
(2)ԼĘ췽ʹsuper(argument_list){ûĘ췽
2.1ʹthis(argument_list){ñ☋췽
2.2{super회췽ĵһ
(3)Ę췽Л]@ʾ{ûĘ췽tϵyĬJ{ûğo췽
(4)췽мț]@ʾ{û췽֛]ПoĘ췽tge
JavaPԇ֪RcP£
СZij֪Rc06-30
xСZij֪RcR07-29
СZij֪RcR02-01
СW֪Rc06-24
Сtlj֪Rc06-26
ӛС֪Rc06-25
ǻ̘Itc֪Rc03-26
СWӢZ40֪Rc03-10
2017пӢZZ֪Rc5008-18
2016п֪Rcw{01-23