摘要: 今天在编译Java程序的时候出现以下错误:No enclosing instance of type Main is accessible. Must qualify the allocation with an enclosing instance of type Main (e.g. x.new... 阅读全文
posted @ 2015-04-11 18:05 伟大的臭猪猪 阅读(1318) 评论(0) 推荐(0)
摘要: 什么时候用到hashcode,什么时候用到equals?首先java为每个对象都生成有默认的hashcode,这个java core里说是java对象的内存地址,但是equals方法里比较的也是对象的内存存储地址,感觉java不会这么设计。看到一篇博文,http://www.cnblogs.com/... 阅读全文
posted @ 2015-04-11 18:03 伟大的臭猪猪 阅读(267) 评论(0) 推荐(0)