Java??????????
???????????? ???????[ 2014/9/11 11:01:21 ] ????????Java ???????
????java??????????C??C++?????????????????java?????????????????????????????????????????????????????.????????????壬python??ruby??????????C??C++??Java???????????????????????????java?????????????java?????????Reflection????????????????????java??????????????
????1??????????ж???????????????е????????????
????2??????????????????????????
????3??????????ж???????????????????
????4????????????????????????????
??????java??jdk?У???java.lang.reflect??????e?????5????????????
????1??Class???????????
????2??Constructor??????????????????????????????????
????3??Field????????????????????????
????4??Method???????????????????????????????
????5??Array???????????????飬????????????????????????
????Class ??????????????????????????Object???????class?????????????????class loader????defineClass()??JVM?????JVM ????????????Class ????Class????й?????????????????ɡ?
??????????java????????????????Class????????????????????
????String str = "CIACs";
????1??Class c1 = str.getClass();
????2??Class c2 = Class.forName("java.lang.String");//????Class????????
????3??Class c3 = String.class;//???????????????class
???????Class???????????????????????????д????????????????????????????????????????????????????????????
????1?????newInstance()????????
????Class<?> classType = str.getClass();
????Object obj = classType.newInstance();
????2??????????????
????Class<?> classType = str.getClass();
????Constructor con = classType.getConstructor(new Class[]{});
????Object obj = con.newInstance(new Object[]{});
????????????????????????????????????????????·???
????Class<?> classType = str.getClass();
????Constructor con = classType.getConstructor(new Class[]{String.class});
????Object obj = con.newInstance(new Object[]{"CIACs"});
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11