Java考試格林模擬習題
question 16)
which of the following statements are true?
1) methods cannot be overriden to be more private
2) static methods cannot be overloaded
3) private methods cannot be overloaded
4) an overloaded method cannot throw exceptions not checked in the base class
question 17)
what will happen if you attempt to compile and run the following code?
class base {}class sub extends base {}class sub2 extends base {}public class cex{ public static void main(string argv[]){ base b=new base(); sub s=(sub) b; }}
1) compile and run without error
2) compile time exception
3) runtime exception
question 18)
which of the following statements are true?
1) tln( -1 >>> 2);will output a result larger than 10
2) tln( -1 >>> 2); will output a positive number
3) tln( 2 >> 1); will output the number 1
4) tln( 1 <<< 2); will output the number
-
Java中goto實現方法
Java語言中goto是保留關鍵字,沒有goto語句,也沒有任何使用goto關鍵字的地方。下面YJBYS小編為大家整理了關於Java中goto實現方法,希望對你有所幫助。Java中也可在特定情況下,通過特定的手段,來實現goto的功能。顯然Java不願意開發者隨意跳轉程序。下面解釋兩個特定:...
-
2016年Java考試精選練習題及答案
1java類可以作為(C)A類型定義機制B數據封裝機制C類型定義機制和數據封裝機制D上述都不對2在創建對象時,必須(C)A先聲明對象,然後才能使用對象B先聲明對象,為對象分配內存空間,然後才能使用對象C先聲明對象,為對象分配內存空間,對對象初始化,然後才能使用對象D上述説法...
-
2016年《JAVA程序設計》期末考試試題
與傳統程序不同,Sun公司在推出Java之際就將其作為一種開放的技術。Java編程語言是個簡單、面向對象、分佈式、解釋性、健壯、安全與系統無關、可移植、高性能、多線程和靜態的語言。下面一起來看看《JAVA程序設計》期末考試試題及答案,希望對同學們的複習有所幫...
-
java程序員必備八大開發工具
現在有很多庫、實用工具和程序任Java開發人員選擇。每個工具都有其優點,但其中有一些因它的知名度、多功能性和有效性從眾多選項中脱穎而出。以下這8個工具,從代碼構建到錯誤擠壓,覆蓋Java開發的全域。學習這些工具可以幫助你改善代碼質量,成為一個更高效的Java開...