Java考試格林練習題
question 11)
what will be the result of attempting to compile and run the following code?
abstract class minebase { abstract void amethod(); static int i;}public class mine extends minebase { public static void main(string argv[]){ int[] ar=new int[5]; for(i=0;i < th;i++) tln(ar[i]); }}
1) a sequence of 5 0’s will be printed
2) error: ar is used before it is initialized
3) error mine must be declared abstract
4) indexoutofboundes error
question 12)
what will be printed out if you attempt to compile and run the following code ?
int i=1; switch (i) { case 0: tln("zero"); break; case 1: tln("one"); case 2: tln("two"); default: tln("default"); }
1) one
2) one, default
3) one, two, default
4) default
question 13)
what will be printed out if you attempt to compile and run the following code?
int i=9;switch (i) { default: tln("default"); case 0: tln("zero"); break; case 1: tln("one"); case 2: tln("two");}
1) default
2) default, zero
3) error default clause not defined
4) no output displayed
-
JS控制html控件的方法
為了方便廣大計算機愛好者,下面YJBYS小編為大家整理了關於JS控制html控件的方法,希望對你有所幫助。方法一:《divid=myDiv》《/div》//容器varstrInnerHtml=《inputid=myInputtype=text》;//要添加的控件rHTML=strInnerHtml;//執行添加動作方法二:《divid=myDiv》...
-
2016年Java認證考試題
Java編程語言是個簡單、面向對象、分佈式、解釋性、健壯、安全與系統無關、可移植、高性能、多線程和靜態的語言。下面來看看java認證的考試題!1.在Java中,負責對字節代碼解釋執行的是A.應用服務器B.虛擬機C.垃圾回收器D.編譯器2.一個棧的輸入序列為12345,則下列...
-
關於Java堆、棧和常量池的介紹
常量池指在java用於保存在編譯期已確定的,已編譯的class文件中的一份數據。下面小編準備了關於Java堆、棧和常量池的介紹,歡迎大家參考!1.寄存器:最快的存儲區,由編譯器根據需求進行分配,我們在程序中無法控制。2.棧:存放基本類型的變量數據和對象的引用,但對象本身不...
-
Ubuntu下Java環境的搭建
配置命令:$sdoapt-getinstallubuntu-restricted-extras再運行如下命令:$sudoapt-getinstallsun-java6-jdk待安裝完畢後選擇默認Java.$sudoupdate-alternatives——configjava安裝過程提示選擇,輸入2即可,然後按回車鍵確定。如果一切順利,便可開始配置環境...