随笔分类 -  Java

关于字节对齐以及内存占用
摘要:参考博文: http://www.javamex.com/tutorials/memory/object_memory_usage.shtml 本文主要考虑正常情况下一个对象在堆上的内存占用情况:对于下面的特殊情况不作讨论 1、某些情况下,JVM可能不会把对象存储在堆上:比如小的线程私有对象原则上会 阅读全文

posted @ 2016-08-10 14:12 CoolRandy 阅读(2640) 评论(0) 推荐(0)

关于Java中的GUI事件处理
摘要:关于事件监听的实现过程通过下面的代码来具体说明: 1 package com.sxt; 2 3 import java.awt.BorderLayout; 4 import java.awt.event.ActionEvent; 5 import java.awt.event.ActionList... 阅读全文

posted @ 2014-04-26 17:21 CoolRandy 阅读(432) 评论(0) 推荐(0)

Java内部类、静态嵌套类、局部内部类、匿名内部类
摘要:Nested classes are further divided into two types:static nested classes: If the nested class is static, then it’s called static nested class. Static n... 阅读全文

posted @ 2014-04-20 10:30 CoolRandy 阅读(406) 评论(0) 推荐(0)

关于Set-List-Map的比较学习
摘要:在介绍之前,先来看一下:The Interface and Class Hierarchy Diagram of Java Collections1. Collection vs CollectionsFirst of all, “Collection” and “Collections” are ... 阅读全文

posted @ 2014-04-11 13:41 CoolRandy 阅读(659) 评论(0) 推荐(0)

java对象equals方法的重写
摘要:根类Object中的equals方法描述:publicbooleanequals(Objectobj)Theequalsmethod for classObjectimplements the most discriminating possible equivalence relation on ... 阅读全文

posted @ 2013-07-06 17:49 CoolRandy 阅读(790) 评论(0) 推荐(0)