首頁 - 網校 - 萬題庫 - 美好明天 - 直播 - 導航
您現在的位置: 考試吧 > 計算機等級考試 > 計算機二級考試 > JAVA > 模擬試題 > 正文

2018年12月計算機二級Java考試沖刺題及答案(3)

來源:考試吧 2018-11-27 17:55:14 要考試,上考試吧! 萬題庫
“2018年12月計算機二級Java考試沖刺題及答案(3)”供考生參考。更多計算機等級考試模擬試題等信息請訪問考試吧計算機等級考試網。
第 1 頁:試題
第 2 頁:參考答案

  點擊查看:2018年12月計算機二級Java考試沖刺題及答案匯總

  1.下列選項成員變量聲明正確的是()。

  A.publicprotectedfinalinti;

  B.abstractclassFl{…}

  C.privatedoubleheight;

  D.doubleweight()

  2.下面程序段的輸出結果是()。

  classTest{

  publics,taticvoidmain(Stringargs[]){

  MyThreadt=newMyThread();

  t.displayOutput("thasbeencreateD");

  t.start();

  }

  }

  ClassMyThreadextendsThread{

  publicvoiddisplayOutput(Strings){

  System.out.println(s);

  }

  publicvoidrun(){

  displayOutput("tisrunning.");

  }

  }

  A.thasbeencreated.

  B.thasbeencreated.tisrunning.

  C.tisrunning.

  D.編譯出錯

  3.執(zhí)行下列程序時,會產生什么異常()。

  publicclassTest{

  publicstaticvoidmain(Stringargs[]){

  intd=101;

  intb=220:

  longa=321;

  System.OUt.println((a-b)/(a-b-d));

  }

  }

  A.ArraylndexOutOfBoundsException

  B.NumberFormatException

  C.ArithmeticException

  D.EOFExeeption

  4.下面程序段的輸出結果為()。

  publicclassTest

  {

  publicstaticvoidmain(Stringargs[])

  {

  booleana,b,C;

  a=(3<5):

  b=(a==true);

  System.out.println("a="+a+"b="+b);

  c=(b==false);

  System.out.println("b="+b+"c="+c);

  }

  }

  A.a=trueb=falseB.fl=trueb=false

  b=truec=trueb=truec=false

  C.a=trueb=trueD.a=falseb=false

  b=truec=falseb=truec=false

  5.下面程序段的輸出結果是()。

  publicclassTest{

  publicstaticvoidmain(Stringargs[]){

  inta,b;

  for(a=1,b=1;a<=100;a++){

  if(b>=10)break;

  if(b%2==1){

  b+=2:

  continue;

  }

  }

  System.OUt.println(a);

  }

  }

  A.5B.6

  C.7D.101

  6.棧中允許進行插入和刪除的一端稱為()。

  A.棧頂B.棧底

  C.棧端D.棧尾

  7.下面程序段的輸出結果是()。

  publicclassTest{

  publicstaticvoidmain(Stringargs[]){

  inti=1:

  switch(i){

  case0:

  System.OUt.println("0");

  break;

  casel:

  System.out.println("1");

  case2:

  System.OUt.println("2");

  break;

  default:

  System.out.println("default");

  }

  }

  }

  A.01

  B.12

  C.10

  D.21

  8.Frame默認的布局管理器是()。

  A.FlowLayout

  B.BorderLayout

  C.GridLayout

  D.UpLayout

  9.在Java語言中,ObjectOutputStream是指()。

  A.字節(jié)流

  B.字符流

  C.對象輸出流

  D.數據流

  10.請閱讀下列程序代碼,然后將程序的執(zhí)行結果補充完整。橫線處應填寫的內容是()。

  程序代碼:

  publicclassthrowsExeeption{

  staticvoidProc(intsel)

  throwsArithmeticException,ArrayIndexOutOf

  BoundsException{

  System.out.println("InSituation"+sel);

  if(sel==0){

  System.OUt.println("noExceptioncaught");

  return;

  }

  elseif(sel==l){

  intiArray[]=newint[4];

  iArray[1]=3;

  }

  }

  publicstaticvoidmain(Stringargs[]){

  try{

  Proe(O);

  Proc(1);

  }

  catch(ArrayIndexOutOfBoundsExceptione){

  System.out.println("Catch"+e);

  }

  finally{

  System.out.println("inProcfinally"):

  }

  }

  }

  執(zhí)行結果:

  InSituation0

  noExceptioncaught

  inProcfinally

  A.InSituationl

  B.InSituation

  C.withCatch

  D.intiArrayl

掃描/長按二維碼幫助考試通關
2018年等考報考資訊
2018等考各科通關技巧
2018各科最新預測試卷
2018等考各科備考資料

微信搜索"考試吧"了解更多考試資訊、下載備考資料

  相關推薦:

  2018年12月全國計算機等級考試必做試題匯總

  2018年全國計算機等級考試必做試題匯總(各科目)

  各地2018年12月全國計算機等考準考證打印時間匯總

  2018年全國計算機等級考試復習知識點匯總(各科目)

  2018全國計算機等級考試備考經驗及應試技巧匯總

0
收藏該文章
0
收藏該文章
文章搜索
萬題庫小程序
萬題庫小程序
·章節(jié)視頻 ·章節(jié)練習
·免費真題 ·?荚囶}
微信掃碼,立即獲取!
掃碼免費使用
版權聲明:如果計算機等級考試網所轉載內容不慎侵犯了您的權益,請與我們聯系800@exam8.com,我們將會及時處理。如轉載本計算機等級考試網內容,請注明出處。
在線模擬試題
考證通關殺器
考試最新資訊
一次通關技巧