2007年9月27日 星期四

Homework 9/21/2007

1. Explain bytecode, JVM
bytecode
The Java compiler translates your Java program into a language called bytecode,which isthe machine language for a fictitious computer.It is easy to translate this bytecode into the machine language of any particular computer.Each type of computer will have its own interpreter that translates and executes bytecode instructions.
JVM
The Java Virtual Machine is very similar to all typical computers.Thus,it iseasy to translate a program written in bytecode into a program in the machine laguage for any particular computer.
2.Explain class, object
Class
物件導向設計中,物件並不是憑空產生的,你必須先定義你的物件,你要ㄧ個規格書,這個規格書稱之為類別(Class)
Object
object(物件):將一組彼此相關的「程序」(Procedure)和「資料」(Data),由軟體程式碼將他們封裝起來這些程序為物件之「方法」(Method);資料則為「成員變數」(Field)「物件」是「類別的實例(an instace of a class)」一般來說類別必須要宣告物件(Object),才能使用(執行)
3. Reading Assignments:Read 1.1, 1.2, 1.3 of Textbook
4.1 Write a Java program as follows:
Let i=2;
Print i;
Print 2 * (i++);
Print i;

















4.2 Write a Java program as follows:
Let i=2;
Print i;
Print 2 * (++i);
Print i;






















4.3 Write a Java program as follows:
Let m=7, n=2;
Print (double) m/n;
Print m/ (double)n;

2007年9月21日 星期五

2007年9月15日 星期六

大家好

大家好 我是林士傑 叫我小華也可以 歡迎來到我的部落格