Java考試格林練習試題
question 6)
which of the following are keywords or reserved words in java?
1) if
2) then
3) goto
4) while
5) case
question 7)
which of the following are legal identifiers
1) 2variable
2) variable2
3) _whatavariable
4) _3_
5) $anothervar
6) #myvar
question 8)
what will happen when you compile and run the following code?
public class myclass{ static int i; public static void main(string argv[]){ tln(i); }}
1) error variable i may not have been initialized
2) null
3) 1
4) 0
question 9)
what will happen if you try to compile and run the following code?
public class q { public static void main(string argv[]){ int anar[]=new int[]{1,2,3}; tln(anar[1]); }}
1) 1
2) error anar is referenced before it is initialized
3) 2
4) error: size of array must be defined
question 10)
what will happen if you try to compile and run the following code?
public class q { public static void main(string argv[]){ int anar[]=new int[5]; tln(anar[0]); }}
1) error: anar is referenced before it is initialized
2) null
3) 0
4) 5
-
Java遠程通訊可選技術及原理
一個最基礎的問題就是遠程服務是怎麼通訊的,在Java領域中有很多可實現遠程通訊的技術,例如:RMI、MINA、ESB、Burlap、Hessian、SOAP、EJB和JMS等,這些名詞之間到底是些什麼關係呢,它們背後到底是基於什麼原理實現的呢,瞭解這些是實現分佈式服務框架的基礎知識,而如果...
-
2016年Java認證筆試題及答案
一、單項選擇題是從()語言改進重新設計。B.C++calC答案:B2.下列語句哪一個正確()A.Java程序經編譯後會產生machinecode程序經編譯後會產生bytecode程序經編譯後會產生DLLD.以上都不正確答案:B3.下列説法正確的有()s中的constructor不可省略B.constructor必須與cl...
-
Java中類的設計技巧有哪些
在Java面向對象編程的過程中,類的設計是一個很有挑戰性的工作,不同的人可能對於類的理解不一樣,設計出來的類也可能不一樣,下文yjbys小編為大家分享的是關於java類的設計技巧,希望對大家學習java有幫助!1)一定將數據設計為私有。最重要的是:絕對不要破壞封裝性。...
-
J2ME在移動設備上實現動畫程序方法
任何動畫的最基本的前提,是要在足夠快的時間內顯示和更換一張張的圖片,讓人的眼睛看到動的畫面效果。圖片必須按照順序畫出來。從一張圖片到下一張圖片之間的變化越小,效果會越好。首先要做的,是使用你的圖片處理軟件(比如ps或者firework)創建一系列相同大小的圖片...