![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java
sinat_30666843
这个作者很懒,什么都没留下…
展开
-
重磅!关于为什么成员(内部)类不能拥有静态字段,方法的问题。
搜索了很多资料,最后从stackOverflow看到了比较靠谱的解释: "suppose there are two instances of outer class & they both have instantiated inner class.Now if inner class has one static member then it will keep only one cop原创 2018-01-16 23:05:58 · 590 阅读 · 0 评论 -
Map.Entry<k,v>
对于内部接口,只能实现它,所以不管静态与否(实质static关键字在这里没意义),都可以OuterName.InnerName这样引用,接口不在乎于这个问题。Map$Entry.class源码可看出,没用糖,与普通接口别无二致,只是名字辨识而已。 就是一普通接口,甚至没引用外围类,加个map方便识别它的用途。原创 2018-01-28 22:04:07 · 358 阅读 · 3 评论