"tell me and I'll forget; show me and I may remember; involve me and I'll understand"
1. Explain bytecode, JVM
Byte-Code:可將我們所寫的程式經過編譯後產出的中間碼。
JVM:Java Virtual Machine.一個以軟體模擬出來的機器環境,可用來執行java 的 byte code。
2. Explain class, object
class是object的集合,用來描述屬性(Property)跟方法(Method)。
object是物件,包含在CLASS裡
4.1 Write a Java program as follows:
Let i=2;
Print i;
Print 2 * (i++);
Print i;
Ans: 2, 4, 3
4.2 Write a Java program as follows:
Let i=2;
Print i;
Print 2 * (++i);
Print i;
Ans: 2, 6, 3
4.3 Write a Java program as follows:
Let m=7, n=2;
Print (double) m/n;
Print m/ (double)n;
Ans: 3.5, 3.5
沒有留言:
張貼留言