• <nav id="cwumo"><code id="cwumo"></code></nav>
  • <menu id="cwumo"><strong id="cwumo"></strong></menu>

    9月計算機二級考試JAVA試題

    時間:2024-08-10 09:57:04 計算機等級 我要投稿

    2017年9月計算機二級考試JAVA試題

      過去,人們主要通過實驗和理論兩種途徑進行科學技術研究。現在,計算和模擬已成為研究工作的第三條途徑。yjbys小編收集了一些關于算機二級考試JAVA試題,歡迎大家前來練習~!

    2017年9月計算機二級考試JAVA試題

      單選題

      1). 設有棧S和隊列Q,其狀態為空,元素a1,a2,a3,a4,a5,a6依次入棧,出棧的元素則進入隊列Q,若6個元素出列的順序是a2,a3,a4,a6,a5,a1,則棧的容量至少是____。

      A.6

      B.4

      C.3

      D.2

      正確答案:C

      2). 下面對對象概念描述錯誤的是

      A.任何對象都必須有繼承性

      B.對象是屬性和方法的封裝體

      C.對象間的通訊靠消息傳遞

      D.操作是對象的動態屬性

      正確答案:A

      3). 概要設計的結果是提供一份

      A.模塊說明書

      B.框圖

      C.程序

      D.數據結構

      正確答案:A

      4). 在Java中,一個類可同時定義許多同名的方法,這些方法的形式參數的個數、類型或順序各不相同,傳回的值也可以不相同,這種面向對象程序特性稱為

      A.隱藏

      B.覆蓋

      C.重載

      D.Java不支持此特性

      正確答案:C

      5). 在Java中,由Java編譯器自動導入,而無需在程序中用import導入的包是____。

      A.java.applet

      B.java.awt

      C.java.util

      D.java.lang

      正確答案:D

      6). 樹最適合用來表示____。

      A.有序數組元素

      B.無序數組元素

      C.元素之間具有分支層次關系的數據

      D.元素之間無聯系的數據

      正確答案:C

      二、基本操作題

      本題將數組中arr[]={5,6,3,7,9,1}的各個元素按下標的逆序輸出。

      publicclassjaval{

      publicstaticvoidmain(String[]args){

      intarr[]={5,6,3,7,9,1};

      ;

      n=;

      while(n>=O){

      System.OUt.print(arr[n]+"");

      ;

      }

      }

      }

      三、簡單應用題

      本題中,用表格表現某個月的月歷,其中標題是從Sunday到Saturday,表格中的各項是可以修改的。

      importjava.awt.*;

      importjava.awt.event.*;

      importjavax.swing.*;

      importjavax.swing.table.*;

      publicclassjava2

      (

      publicstaticvoidmain(String[]args)

      {

      try{

      UIManager.setLookAndFeel(UIManager.getSys-

      temLookAndFeelClassName()):

      }

      catch(Exceptione)()

      JFrameframe=newCalendarTableFrame();

      frame.setDefaultCloseOperation(JFrame.EXIT_

      oNCLOSE);

      frame.show();

      }

      }

      clasgCalendarTableFrameextendsJFrame

      {

      privatestaticfinalintWIDTH=500;

      privatestaticfinalintHEIGHT=150:

      privatecells=

      {

      {null,null,null,newInteger(1),newInteger

      (2),newInteger(3),newInteger(4)),

      {newInteger(5),newInteger(6),newInteger

      (7).newInteger(8),newInteger(9),newInteger

      (10),newInteger(11)),

      {newInteger(12),newInteger(13),newInteger

      (14),newInteger(15),newInteger(16),newInteger

      (17),newInteger(18)),

      {newInteger(19),newInteger(20),newInteger

      (21),newInteger(22),newInteger(23),newInteger

      (24),newInteger(25)),

      {newInteger(26),newInteger(27),newInteger

      (28),newInteger(29),newInteger(30),newInteger

      (31),null}

      };

      privateString[]columnNames={

      "Sunday","Monday","Tuesday","Wednesday",

      "Thursday","Friday","Saturday"

      };

      publicCalendarTableFrame(){

      setTitle("java2");

      setSize(WIDTH,HEIGHT);

      JTabletable=new;

      getContentPane().add(newJScrollPane(table),

      BorderLayout.CENTER);

      }

      }

    【9月計算機二級考試JAVA試題】相關文章:

    2017年9月計算機二級JAVA考試試題及答案07-03

    9月計算機二級web考試試題及答案10-30

    2017年9月計算機二級考試VB考試試題08-13

    9月計算機等級考試二級MS考試試題及答案10-08

    9月計算機二級考試考前模擬試題及答案10-29

    2017年9月計算機二級C++考試模擬試題07-30

    2017年9月計算機二級VB考試測試題09-17

    2017年9月計算機二級VB考試試題及答案09-04

    2017年9月計算機二級C++考試試題05-13

    2017年9月計算機二級MS Office考試試題10-27

    日韩激情