顯示具有 JAVA 標籤的文章。 顯示所有文章
顯示具有 JAVA 標籤的文章。 顯示所有文章

2014年2月15日 星期六

Lesson: Object-Oriented Programming Concepts

Lesson: Object-Oriented Programming Concepts
(物件導向元件)

Object(物件), Class(類別), Inheritance(繼承), Interface(介面), Package(封包)

Object
1. 狀態與行為
    任何東西都有"狀態與行為",例如狗狗有狀態[名字、顏色、血統、飢餓度];有行為[吠、撿東西、搖尾巴]

First hello world

from "http://docs.oracle.com/javase/tutorial/index.html"


class HelloWorldApp {
    public static void main(String[] args) {
        System.out.println("Hello World!"); // Display the string.
    }
}
 
 
1. class named HelloWorldApp
2. public static void main(String[] args)
   "public static" 可以交換順序,一般寫為public static
   args 為 arguments (?),一般寫為args或argv
   基本的main
3. String[] args (不確定,這邊說ignore augrments)
4. System.out.println 輸出文字指令