1. 第一堂課
    1. Course Objectives
      1. The different types of programming
        1. 機械語言(Machine languages)
        2. 組合語言(Assembly languages)
        3. 高階語言(High-level languages)
      2. What is java?
        1. Language Feather
        2. Java SE 5+ Feather
      3. Resource
        1. Java White Paper
        2. The Java Tutorials
    2. Before You Begin
      1. Download and Install Java JDK
      2. Setting the PATH Variable
    3. Java SE架構圖
    4. Java environment
      1. jdk
        1. Verify in console
        2. javac
        3. java
      2. 整合開發環境(IDE)
        1. Netbeans
        2. Eclipse
      3. 編輯器(Editor)
        1. Notepad++
        2. Vim
    5. Java Application
      1. package
      2. import
        1. default import: java.lang.*
        2. import static
      3. class
      4. comment
        1. 寫註解有助於別人能夠迅速了解你的原始碼
        2. 單行註解(//)
        3. 分支主題
      5. 輸出(Output)
        1. err.print
          1. java className >> log.txt
          2. 不會進入到檔案中 會在終端機輸出
          3. using in ExceptionHandling
        2. out.print
        3. out.println
          1. java.util.regex
        4. out.printf
          1. (String) %s
          2. (char) %c
          3. (int.short.long.byte) %d
          4. (boolean) %b
          5. (double.float) %f
          6. %n
          7. %tD %tF %tc
          8. java.util.Formatter
        5. javax.swing.JOpitionPane.showMessageDialog(args...)
      6. 輸入(Input)
        1. new Scanner(System.in)
          1. next()
          2. nextLine()
          3. nextInt()
          4. nextDouble()
          5. ...
        2. javax.swing.JOpitionPane.showInputDialog(args...)
  2. 第二堂課
    1. 結構(Structure)
      1. 依照流程控制的特性能夠讓程式更多樣化
      2. 直述式(Squence)
      3. 選擇式(Selection)
      4. 重複式(Repetition)
    2. 流程控制(flow-control)
      1. 選擇式敘述(Selection statements)
        1. if-else
          1. if-else
          2. if-else if-else
          3. ? :
          4. argument can be a interval or a value
        2. switch
          1. case
          2. default
          3. argument only access a value
      2. 重複式敘述(Repetition statements)
        1. for
          1. fori
          2. fore
        2. while
          1. while
          2. do-while
      3. label
        1. 只能接於迴圈前面
        2. 單行
        3. 多行{}
      4. break
        1. 離開迴圈
      5. continue
        1. 離開本次迴圈
    3. 運算子(Operators)
      1. 算數運算子(Arithmetic Operators)
        1. 加(+)
        2. 減(-)
        3. 乘(*)
        4. 除(/)
        5. 餘(%)
      2. 算數轉換(Arithmrtic conversion)
        1. 隱式型態轉換(Implicit type conversion)
        2. 顯式型態轉換(Explicit type conversion)
      3. 比較運算子(Comparsion operator)
        1. 小於(<)
        2. 不大於(<=)
        3. 大於(>)
        4. 不小於(>=)
        5. 等於(==)
        6. 不等於(!=)
      4. 條件運算子(Conditional operator)
        1. [條件式] ? [成立傳回值] : [失敗傳回值]
      5. Increment and Decrement Operators
        1. 遞增(++)
        2. 遞減(--)
        3. i++, ++i
      6. Logical Operators
        1. 且(&&)
        2. 或(||)
        3. 反相(!)
        4. &
        5. |
        6. ^
          1. Different: true
          2. Same: false
  3. 第三堂課
    1. 攥寫規則
      1. 類別首字大寫
      2. 方法首字小寫
      3. 變數首字小寫
      4. 若有兩個字以上相接 第二個字字首大寫
    2. 修飾字
      1. 存取型態(access_spedifiers)
        1. 公開(public)
        2. 保護(protected)
        3. 匿名(package)
        4. 私有(private)
      2. 限定型態(qualifiers)
        1. 靜態(static)
          1. 類別層級(static)
          2. ClassName.member
          3. ex: Math class
          4. import static
          5. 實體層級(non-static)
          6. objectName.member
        2. 最終(final)
          1. class: 不能被繼承(Extends)
          2. method: 不能被覆寫(Override)
          3. attribute: 不能被改變 換句話說就是常數(Constant)
          4. 通常大寫命名
        3. 抽象(abstract)
    3. 類別成員(class members)
      1. 屬性 (attritube)
        1. 基本型別(PrimitiveType)
          1. 基本運算如加減乘除 均已被定義 若是外覆類別 則無法廣泛定義
          2. boolean
          3. initial value: false
          4. byte
          5. initial value: 0
          6. -128 ~ 127
          7. 1 byte
          8. short
          9. initial value: 0
          10. -32768 ~ 32767
          11. 2 bytes
          12. int
          13. initial value: 0
          14. -21e ~ +21e
          15. 4 bytes
          16. long
          17. initial value: 0
          18. 8 bytes
          19. + l
          20. char
          21. initial value: ''
          22. 2 bytes
          23. float
          24. initial value: 0.0
          25. 4 bytes
          26. + f
          27. double
          28. initial value: 0.0
          29. 8 bytes
        2. 參考型別(ReferenceType)
          1. String
          2. String str = new String("Hello")
          3. String str = "Hello"
          4. str.length()
          5. Array[]
          6. int[] a = new int[]{1,2,3}
          7. 分支主題
          8. array.length
          9. 外覆類別(Wrapper Class)
          10. 自動裝箱(AutoBoxing) and 自動拆箱(UnBoxing)
          11. Scanner
          12. Date
          13. Thread
          14. ...
        3. 宣告(Declaration)
          1. 資料型別(DataType)
          2. 基本型別(Primitive)
          3. 參考型別(Reference)
          4. attritube_name
          5. [ $, _ ] 可做變數名稱
        4. 建構(Create)
          1. keyword: new
        5. 初始化(initalization)
          1. initial value
          2. constructor
      2. 方法(method)
        1. 回傳值(return_type)
          1. non-void
          2. 基本型別(Primitive)
          3. 參考型別(Reference)
          4. keyword: return
          5. void
        2. 方法名稱(method_name)
        3. 方法參數(argument_list)
          1. 多載(Overload)
          2. (dataType... args)
          3. 可變長度的參數 (VariableArguments)
          4. 當有兩個參數以上時 可變的參數必須擺後面
        4. 方法區塊(block)
          1. //implement content
        5. 覆寫(Override)
        6. 建構子(Constructor)
          1. 不傳回值與類別同名
          2. 建構物件用
      3. UML類別圖
        1. +(public)
        2. #(package)
        3. ~(protected)
        4. -(private)
  4. 第四堂課
    1. 抽象(abstract)
      1. not implemented rule
      2. cann't use on attritube
      3. can not be instantiated
      4. abstract -><- final
    2. 封裝(Encupsulation)
      1. Data hiding
      2. Getter and Setter
      3. public method
      4. boolean isXXX()
    3. 繼承(inheritance)
      1. reusable, not create again
      2. keyword: extends
      3. 單一繼承(single-inheritance)
      4. super and sub
        1. all members be iheritantiated
      5. super and this
        1. always on top
        2. 分支主題
        3. super -><- this
      6. Access
        1. protected
          1. sub can access
        2. private
          1. only self
    4. 多型(polymorphism)
      1. call all subclass's method
      2. it can do it
      3. Basic: SuperType sup = new SubType();
      4. Advanced: SuperType[] sup = {subObject ... };
    5. 介面(interface)
      1. 突破單一繼承的限制
      2. keyword: implements
      3. always be abstract
      4. new Interface(){ //implements content }
      5. [attributes] public static final
      6. [methods] public abstract
  5. 第五堂課
    1. 例外處理(Exception Handling)
      1. 當程式執行中 拋出exception 我一定只能讓程式中斷掉嗎?
      2. we need exception handling such that the program can be continued
      3. syntax
        1. keyword: try, catch, finally, throws, throw
        2. in try block, if exception occurs, the code after the break point will not run.
      4. try
        1. 找出炸彈在哪裡
        2. 分支主題
        3. ArrayIndexOutOfBoundsException
        4. ClassCastException
        5. ClassNotFoundException
        6. InputMismatchException
        7. NullPoniterException
        8. NumberFormatException
        9. RuntimeException
          1. 當輸入的參數在不可接受的範圍時
          2. ex: JOptionPane.showConfirmDialog() massageType = 1000
        10. ...
        11. 如果是在方法內 建議使用throws 使得呼叫此方法的時候 強迫使用例外處理
      5. catch
        1. have order from sub to super
        2. System.exit(int i);
      6. finally
        1. must be run
      7. try-catch, try-finally, try-catch-finally
      8. 斷言(assert)
        1. 預設不被啟用 需加上 -ea 參數來執行(java -ea .class)
        2. 如果不啟用 含有assert的行將不被執行
        3. assert (condition) : statement ;
    2. 學習資源
      1. 良葛格的學習筆記
  6. 第六堂課
    1. java.io
      1. File
        1. canRead()
        2. canWrite()
        3. exists()
        4. isFile()
        5. isDirectory()
        6. isAbsolutePath()
        7. getName()
        8. getPath()
        9. getParent()
        10. length()
        11. lastModified()
          1. 試著將傳回的long值 轉為Date 並印出
        12. API
    2. output: java.util.Formatter
      1. Formmater output = new Formatter(new File("fileName"))
      2. output.format("%s %d %tF...", args...)
      3. output.close()
    3. input : java.util.Scanner
      1. Scanner input = new Scanner(new File("fileName"))
      2. while(input.hasNext()){}
      3. input.nextLine()
      4. input.close()
    4. 序列化(Serialization)
      1. 有沒有辦法能儲存物件當前的狀態且不讓別人取得物件資訊
      2. implements Serializable
      3. ObjectOutputStream output = new ObjectOutputStream(new FileOutputStream("fileName.ser"))
      4. output.writeObject(Object serialObj)
      5. output.close()
      6. ObjectInputStream input = new ObjectInputStream(new FileInputStream("fileName.ser"))
      7. OriginalType T = (OriginalType)input.readObject()
      8. input.close()
    5. java.nio
      1. Andriod
    6. 擅用IDE 徹底加快你的開發速度 利用自動完成 自行設定
      1. Eclipse
        1. Java -> Editor -> Template
      2. Netbeans
        1. Java -> Editor -> Code Template
      3. JM
        1. JOptionPane.showMessageDialog(null, "Message", "Title", JOptionPane.INFORMATION_MESSAGE);
      4. JC
        1. JOptionPane.showConfirmDialog(null, "Message", "Title", JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE);
      5. JO
      6. In
        1. Integer
      7. Do
        1. Double
      8. Cal
        1. Calendar
      9. pm
        1. public void methodName(Object obj){return;}
      10. newfile
        1. File file = new File("filePath")
      11. newscan
        1. Scanner scan = new Scanner(System.in);
      12. newsf
        1. Scanner input = new Scanner(new File("fileName"))
      13. newf
        1. Formatter output = new Formatter(new File("fileName"))
  7. 第七堂課
    1. 泛型(Generics)
      1. 即使方法可以多載(Overload) 攥寫上還是很不方便
      2. Object
        1. 如果不知原型就會造成CastClassException
        2. 有時候不相容於基本型別
      3. 泛型(廣泛接受所有的型別)提供了模版(Template)的概念
      4. 印出任何陣列型別的值
      5. syntax
        1. class GenericsDemo<T>{}
        2. <T> void generic(T... ){}
      6. 內容(Content)
        1. E : 元素(Element)
        2. T : 模版(Template)
        3. super : 上層
        4. extends : 下層
        5. implements : 實作介面
        6. ? : 常與上述3個關鍵字 相搭
        7. 其內容不限填上述的字 只是其字可代表其意
    2. 集合(Collection)
      1. 陣列的特性
        1. 長度不可變
        2. 元素同型別
      2. 集合特性
        1. Set : 不能包含重複
          1. HashSet
          2. TreeSet : order
        2. List : 可包含重複
          1. ArrayList
          2. LinkedList
          3. Vector
        3. Queue : first-in first-out
          1. PriorityQueue : order
          2. offer()
          3. peek()
          4. poll()
        4. Map : Key-Value
          1. Hashtable
          2. HashMap
          3. TreeMap
      3. Interface: Collection & Class: Collections -> API
      4. java.util.Arrays
      5. java.util.Properties
  8. 第八堂課
    1. 執行緒(Thread)
      1. 我的程式只能夠單工處理嗎?
      2. 有了執行緒 你可以同時執行兩個以上的程式
      3. Restruction
        1. Topic
      4. syntax
        1. Override run() methods
        2. Call start() to start thread
          1. 為什麼不直接call run?
          2. 當你呼叫start()其實間接呼叫到run() 其差別在於start只能啟動一次
        3. extends Thread
        4. implements Runnable
  9. SCJP
    1. java.lang.*
      1. Object
      2. String
        1. concat()
        2. split()
        3. valueOf()
      3. StringBuffer
        1. 常用於多執行緒(mulit-Thread)
        2. append()
        3. insert()
      4. StringBuilder
        1. 常用於單執行緒(single-Thread)
        2. append()
        3. insert()
      5. 外覆類別(Wrapper class)
        1. parseXXX()
        2. valueOf()
      6. Thread
    2. java.util.*
      1. Arrays
        1. binarySearch()
      2. Scanner
      3. Formatter
      4. Date
      5. Calendar
      6. GergorianCalendar
      7. Collection
        1. Collections
          1. sort()
      8. Set
        1. HashSet
        2. TreeSet
      9. List
        1. ArrayList
      10. Queue
        1. PriorityQueue
      11. Map
        1. HashMap
          1. put()
      12. Locale
    3. java.io.*
      1. File
      2. FileReader
      3. FileWriter
      4. BufferReader
      5. BufferWriter
      6. FileInputStream
      7. FileOutputStream
      8. ObjectInputStream
      9. ObjectOutputStream
      10. Console
    4. java.text.*
      1. NumberFormat
      2. DataFormat
    5. Array[]
    6. ...