2007年3月26日 星期一

java 考試 (一)

1. Revise your program for Simple Java Expression according to Java program styles. Check the following(1) the naming of constants, if any,(2) Java spelling conventions, and(3) indenting.




















2. Insert proper comments in your program for Simple Java Expression. Note that there are 2 ways to insert comments: line comments and block comments.









3. The identifier BufferedReader is normally abbreviated as BR in programming language C. However, Java programmers normally do not use abbreviations in identifiers. Can you give some good reasons for using long names in Java?








4. The Java Virtual Machine handles string objects in a way different from the one it handles variables of primitive types such as int, long, float, and double. What is the difference?





ans:





spring 在 java 裡面是個類別為 (class) 的變數





int-integer 整數的方式可記憶 4bytes





long-integer 整數的方式可記憶 8bytes





float 浮點數的方式可記憶 4bytes





double 浮點數的方式可記憶 8bytes

1 則留言:

Yao Jen 提到...

grading
1. 0
2. 8
3. 0
4. 1

total=9