- protected: only methods of the same package, or its subclasses can access protected instance variables.
- private: only methods of the same class (not a subclass) can access.
- final: must be assigned an initial value, and can never be assigned a new value after initialization.
- object-oriented design principles
- abstraction
- encapsulation:封裝性
- modularity
- hierarchial organization
- inheritance繼承性
- polymorphism多態(tài)性
- 接口interface和類(lèi)class
- 相似點(diǎn): 一個(gè)接口可以有多個(gè)方法妓灌;
- 區(qū)別:接口不能用于實(shí)例化對(duì)象闺阱;接口沒(méi)有構(gòu)造方法信姓;接口中所有的方法必須是抽象方法;接口不能含有成員變量,除了static和final 變量施戴;
接口不是被類(lèi)繼承壁榕,而是被類(lèi)實(shí)現(xiàn);接口支持多繼承任内。
- Cryptography密碼學(xué)
cipher 密碼
encryption array 加密矩陣
decryption array 解密矩陣 - single linked list單鏈表
- public class ArrayStack<E>
- 此處<E>表示泛型撵渡,可以為任意變量;
- 比如HashMap<K,V>死嗦,K和V是任意類(lèi)型趋距。
- java.util inculdes:
- Collection
- iterator
- List
- ListIterator
- Map
- Queue
- Set