随笔分类 -  基础知识

abstract vs interface
摘要:interfaces can have no state or implementation,data members must be public final statica class that implements an interface must provide an implementation of all the methods of that interfaceabstract classes may contain state (data members) and/or implementation (methods)abstract classes can be inhe 阅读全文

posted @ 2013-06-13 08:10 brave_bo 阅读(274) 评论(0) 推荐(0)

How Garbage Collection Really Works
摘要:Java Memory ManagementJava Memory Management, with its built-in garbage collection, is one of the language’s finest achievements. It allows developers to create new objects without worrying explicitly about memory allocation and deallocation, because the garbage collector automatically reclaims memo 阅读全文

posted @ 2013-06-13 07:53 brave_bo 阅读(194) 评论(0) 推荐(0)

public private protected 区别
摘要:1、public:public表明該數據成員、成員函數是對所有用戶開放,所有用戶都可以直接進行調用2、private:private表示私有,私有的意思就是除了class自己之外,任何人都不可以直接使用,私有财产神圣不可侵犯嘛,即便是子女,朋友,都不可以使用。3、protected:protected对于子女、朋友来说,就是public的,可以自由使用,没有任何限制,而对于其他的外部class,protected就变成private。作用域 當前類 同一package 子孫類 其他packagepublic √ √ √ √protected √ √ ... 阅读全文

posted @ 2013-06-13 07:48 brave_bo 阅读(533) 评论(0) 推荐(0)

导航