您的位置:首页 > 编程语言 > Java开发

《Cracking the Coding Interview》——第14章:Java——题目5

2014-04-26 19:11 531 查看
2014-04-26 19:06

题目:Java中的对象反射机制是什么?有鼠么用?

解法:完全不了解,因为java编程经验太少,完全没用过。查了一些资料后,感觉反射机制是个强大并需要边用边体会的强大工具。能灵活处理各种动态类型下的问题。

代码:

// 14.5 Tell me something about Object Reflection in java.
// Answer:
//    1. class type, constructor, member method, these are a few characteristics of a class
//    2. the Object Reflection is a collection of tool classes, it is able to handle the situation when you know you want certain behavior, but don't know exactly what type of class you need.
//    3. Unlike generics, it mainly deal with member methods and constructors, while generics focus more about data.
//    4. you may get a specific constructor, a member method with customized constraints.
public class TestJava {
public static void main(String[] args) {
return;
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐