Chapter 7.Better Living in Objectville
来源:互联网 发布:数据库黑客大曝光 编辑:程序博客网 时间:2024/06/01 08:53
Question
- The JVM starts walking up the inheritance tree,
starting at the class type you invoked the method on. But what
happens if the JVM doesn’t ever find a match?- The compiler guarantees that a particular method is callable for a specific reference type,but it doesn’t say (or care) from which class that method actually comes from at runtime.Remember that if a class inherits a method, it has the method.Where the inherited method is defined makes no difference to the compiler.But at runtime, the JVM will always pick the right one. And the right one means, the most specific version for that particular object.
问题
- 虚拟机从你调用方法的类开始向上搜索继承树。当JVM没有找到会发生什么?
- 编译器通过特别的引用类型来保证特定的方法会被调用,在运行时它不会在乎该方法实际上在哪个类找到的。记住,如果类继承一个方法,它便有了那个方法。该方法在哪里被声明对于编译器没有区别。但在运行时,JVM总是会找到正确的方法。正确的方法意思是最接近该类型的版本。
阅读全文
0 0
- Chapter 7.Better Living in Objectville
- Living in Huangpu river
- My comments on living costs in Shanghai
- An advantage of living in BJ.
- II. Positioning---Chapter 3----A Better Way
- ImageIO: Just another example of better living by doing it yourself(收藏)
- Learning, working and living in Hwadee(华迪实习日志)
- The first face-to-face with the living in London
- Better form validation in Flex
- Better types in C++11
- ORCFile in HDP 2: Better Compression, Better Performance
- Better, Faster, Lighter Programming in .NET
- jdbc 4 :Better SQLExceptions in Java 6
- 2007 Nobel in Economics: Designing Better Markets
- Better understand "this" in JQuery plugin
- Why Enum Singleton are better in Java
- Thinking in C++ chapter 1
- Thinking in C++ chapter 2
- EvenBus初学
- 阿里云 CDN HTTPS 最佳实践系列——HTTP/2(二)
- 我们也说说Android.mk(1)
- group by 和 order by区别
- 正则趣事?哈哈哈哈
- Chapter 7.Better Living in Objectville
- html基础-表单控件、密码框、单选按钮、复选框、多行文本框、下拉列表、按钮(提交、图片、重置)
- WeChat小程序学习心得——模板使用
- SpringMVC与Web解读(一):SpringMVC环境构建与ContextLoaderListener
- 多媒体文件管理-数据库external.db,internal.db (一)
- Effective Java其他碎片建议1
- qt creator 内存查看器
- MySql教程____mysql架构体系
- 样式(style)和主题(theme)(一)