• <sub id="h4knl"><ol id="h4knl"></ol></sub>
    <sup id="h4knl"></sup>
      <sub id="h4knl"></sub>

      <sub id="h4knl"><ol id="h4knl"><em id="h4knl"></em></ol></sub><s id="h4knl"></s>
      1. <strong id="h4knl"></strong>

      2. 計算機2級Java檢測試題

        時間:2024-10-15 21:12:38 計算機等級 我要投稿
        • 相關推薦

        2017年計算機2級Java檢測試題

          Java 編程語言是個簡單、面向對象、分布式、解釋性、健壯、安全與系統無關、可移植、高性能、多線程和動態的語言。下面是小編收集的計算機2級Java檢測試題,希望大家認真閱讀!

        2017年計算機2級Java檢測試題

          單選題

          1). 順序存儲結構____。

          A.僅適合于靜態查找表的存儲

          B.僅適合于動態查找表的存儲

          C.既適合靜態又適合動態查找表的存儲

          D.既不適合靜態又不適合動態查找表的存儲

          正確答案:C

          2). 在編寫Java application程序時,若需要使用到標準輸入輸出語句,必須在程序的開頭寫上____語句。

          A.import java.awt.*;

          B.import java.applet.applet;

          C.import java.io.*;

          D.import java.awt.Graphics;

          正確答案:C

          3). 關于以下程序段的執行結果,說法正確的是public class Borley extends Thread{public static void main(String argv[]){Borley b = new Borley(); b.start(); }public void run(){System.out.println("Running");}}

          A.編譯通過并執行,但無輸出

          B.編譯通過并執行,輸出:Running

          C.產生錯誤,沒有Thread類對象

          D.產生錯誤,沒有通道到達Thread包

          正確答案:B

          4). 線性表若采用鏈表存儲結構時,要求內存中可用存儲單元的地址____。

          A.必須是連續的

          B.部分地址必須是連續的

          C.一定是不連續的

          D.連續不連續都可以

          正確答案:D

          5). 在Java中,能實現多重繼承效果的方式是____。

          A.內部類

          B.適配器

          C.接口

          D.同步

          正確答案:C

          6). 在編寫異常處理的Java程序中,每個catch語句塊都應該與____語句塊對應,使得用該語句塊來啟動Java的異常處理機制。

          A.if-else

          B.switch

          C.try

          D.throw

          正確答案:C

          簡單應用題(共24分)

          本題的功能是通過按鈕來選擇窗口顯示的風格。窗口

          中有三個按鈕:“Metal”、“Motif”和“Windows”,單擊任何一

          個按鈕,就能將窗口的風格改變為按鈕名稱所對應的風格。

          import java.awt.*;

          import java.awt.event.*;

          import javax.swing.*;

          class PlafPanel extends JPanel implements ActionLis-

          tener

          {public ()

          {metaIButton=new JButton("Metal");

          motifButtOn=new J Button("Motif");

          windowsButton=new JButton("Windows");

          add(metalButton);

          add(motifButton);

          add(windowsButton);

          metalButton.addActionListener(this);

          motifButton.addActionListener(this);

          windowsButton.addActionListener(this);

          }

          Dublic void actionPerformed(ActionEvent evt)

          {Object source=evt.getSource();

          String plaf="":

          if(source= =metalButton)

          plaf="javax.swing.plaf.metal.MetalLookAnd-

          Feel";

          else if(source= =motifButton)

          plaf="com.sun.java.swing.plaf.motif.Moti-

          fLookAndFeel";

          else if(source= =windowsButton)

          Dlaf="com.sun.java.swing.plaf.windows.Win-

          dowsLookAndFeel";

          try

          {UIManager.setLookAndFeel( );

          SwingUtilities.updateComponentTreeUI(this);

          }

          catch(Exception e){)

          }

          private JButton metalButton;

          private JButton motifButton;

          private JButton windowsButton;

          }

          class PlafFrame extends JFrame

          {public PlafFrame()

          { setTitle("simple");

          setSize(300,200);

          addWindowListener(new WindowAdapter()

          {public void windowClosing(WindowEvent e)

          {System.exit(O);

          }

          });

          Container contentPane=getContentPane();

          contentPane.add(new PlafPanel());

          }

          }

          public class java2

          {public static void main(String[]args)

          f JFrame frame=new PlafFrame();

          frame.show();

          }

        《&.doc》
        将本文的Word文档下载到电脑,方便收藏和打印
        推荐度:
        点击下载文档

        【計算機2級Java檢測試題】相關文章:

        計算機二級java上機試題題庫03-29

        計算機二級Java語言程序設計試題03-10

        計算機應用基礎檢測試題及答案201703-08

        java考試試題及答案10-25

        java基礎筆試題及答案03-03

        2017年java模擬試題03-06

        Java考試格林模擬試題03-23

        經典的Java基礎面試題03-07

        2017年計算機二級JAVA試題附帶答案03-03

        国产高潮无套免费视频_久久九九兔免费精品6_99精品热6080YY久久_国产91久久久久久无码
      3. <sub id="h4knl"><ol id="h4knl"></ol></sub>
        <sup id="h4knl"></sup>
          <sub id="h4knl"></sub>

          <sub id="h4knl"><ol id="h4knl"><em id="h4knl"></em></ol></sub><s id="h4knl"></s>
          1. <strong id="h4knl"></strong>

          2. 日韩在线精品视频 | 亚洲中文精品久久久久久 | 亚洲综合一区二区三区 | 竹菊精品久久久久久久99 | 亚洲成年人网站在线观看 | 中文字幕在线亚洲日韩6页 亚洲亚洲影院第一页 |

            2017年計算機2級Java檢測試題

              Java 編程語言是個簡單、面向對象、分布式、解釋性、健壯、安全與系統無關、可移植、高性能、多線程和動態的語言。下面是小編收集的計算機2級Java檢測試題,希望大家認真閱讀!

            2017年計算機2級Java檢測試題

              單選題

              1). 順序存儲結構____。

              A.僅適合于靜態查找表的存儲

              B.僅適合于動態查找表的存儲

              C.既適合靜態又適合動態查找表的存儲

              D.既不適合靜態又不適合動態查找表的存儲

              正確答案:C

              2). 在編寫Java application程序時,若需要使用到標準輸入輸出語句,必須在程序的開頭寫上____語句。

              A.import java.awt.*;

              B.import java.applet.applet;

              C.import java.io.*;

              D.import java.awt.Graphics;

              正確答案:C

              3). 關于以下程序段的執行結果,說法正確的是public class Borley extends Thread{public static void main(String argv[]){Borley b = new Borley(); b.start(); }public void run(){System.out.println("Running");}}

              A.編譯通過并執行,但無輸出

              B.編譯通過并執行,輸出:Running

              C.產生錯誤,沒有Thread類對象

              D.產生錯誤,沒有通道到達Thread包

              正確答案:B

              4). 線性表若采用鏈表存儲結構時,要求內存中可用存儲單元的地址____。

              A.必須是連續的

              B.部分地址必須是連續的

              C.一定是不連續的

              D.連續不連續都可以

              正確答案:D

              5). 在Java中,能實現多重繼承效果的方式是____。

              A.內部類

              B.適配器

              C.接口

              D.同步

              正確答案:C

              6). 在編寫異常處理的Java程序中,每個catch語句塊都應該與____語句塊對應,使得用該語句塊來啟動Java的異常處理機制。

              A.if-else

              B.switch

              C.try

              D.throw

              正確答案:C

              簡單應用題(共24分)

              本題的功能是通過按鈕來選擇窗口顯示的風格。窗口

              中有三個按鈕:“Metal”、“Motif”和“Windows”,單擊任何一

              個按鈕,就能將窗口的風格改變為按鈕名稱所對應的風格。

              import java.awt.*;

              import java.awt.event.*;

              import javax.swing.*;

              class PlafPanel extends JPanel implements ActionLis-

              tener

              {public ()

              {metaIButton=new JButton("Metal");

              motifButtOn=new J Button("Motif");

              windowsButton=new JButton("Windows");

              add(metalButton);

              add(motifButton);

              add(windowsButton);

              metalButton.addActionListener(this);

              motifButton.addActionListener(this);

              windowsButton.addActionListener(this);

              }

              Dublic void actionPerformed(ActionEvent evt)

              {Object source=evt.getSource();

              String plaf="":

              if(source= =metalButton)

              plaf="javax.swing.plaf.metal.MetalLookAnd-

              Feel";

              else if(source= =motifButton)

              plaf="com.sun.java.swing.plaf.motif.Moti-

              fLookAndFeel";

              else if(source= =windowsButton)

              Dlaf="com.sun.java.swing.plaf.windows.Win-

              dowsLookAndFeel";

              try

              {UIManager.setLookAndFeel( );

              SwingUtilities.updateComponentTreeUI(this);

              }

              catch(Exception e){)

              }

              private JButton metalButton;

              private JButton motifButton;

              private JButton windowsButton;

              }

              class PlafFrame extends JFrame

              {public PlafFrame()

              { setTitle("simple");

              setSize(300,200);

              addWindowListener(new WindowAdapter()

              {public void windowClosing(WindowEvent e)

              {System.exit(O);

              }

              });

              Container contentPane=getContentPane();

              contentPane.add(new PlafPanel());

              }

              }

              public class java2

              {public static void main(String[]args)

              f JFrame frame=new PlafFrame();

              frame.show();

              }