<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    ALL is Well!

    敏捷是一條很長的路,摸索著前進(jìn)著

      BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
      30 隨筆 :: 23 文章 :: 71 評論 :: 0 Trackbacks

    原帖:

    http://topic.csdn.net/u/20090113/17/5abc9a50-64dd-4277-af73-e8d2b762a469.html

     

    我貼過來,自己做一下。

     

    題目1: One team tries to buy several bottle of drinks for 27 athletes. In ABC store three empty bottles can be exchanged

    with one new bottle of drinks. Which of the following numbers is the minimal one that the team should buy for the 27

    athletes?

    答:自己實(shí)現(xiàn)了一個,比較簡單的。
     1/** 
     2 * @author bzwm 
     3 *  
     4 */
     
     5public class BottleTest 
     6    public static void main(String[] args) 
     7        // 放空瓶子的棧 
     8        java.util.Stack<Object> emptyBottles = new java.util.Stack<Object>(); 
     9        // 買的飲料數(shù) 
    10        int bottle = 0
    11        // 喝過飲料的人數(shù) 
    12        int drink = 0
    13        // 空飲料瓶子 
    14        Object emptyBottle = new Object(); 
    15        while (drink < 27
    16            // 一個人喝過了 
    17            drink++
    18            // 把空瓶子放在棧中 
    19            emptyBottles.push(emptyBottle); 
    20            // 買的飲料數(shù)加1 
    21            bottle++
    22            // 如果空瓶子棧中的空瓶數(shù)為3個 
    23            if (emptyBottles.size() == 3
    24                // 將三個瓶子拿去商店換飲料 
    25                emptyBottles.pop(); 
    26                emptyBottles.pop(); 
    27                emptyBottles.pop(); 
    28                // 一個人喝過飲料 
    29                drink++
    30                // 將空瓶子再放在棧中 
    31                emptyBottles.push(emptyBottle); 
    32            }
     
    33        }
     
    34        System.out.println(bottle); 
    35    }
     
    36}

    題目2: How can you create a listener class that receives events when the mouse is moved(single Answer)

    A By extending MouseListener

    B By implementing MouseListener
    C By extending Mouse Motion Listener
    D By implementing Mouse Motion Listener
    E Either by extending Mouse Motion Listener  or extending MouseListener
    F Either by implementing Mouse Motion Listener  or  implementing MouseListener

     

     

     

    題目3: You are assign the task of building a panel containing a TextArea at the top, a label directly below it, and a button

    directly below the label. If the three components are added directly to the panel, which layout manager can be panel use to

    ensure that the TextArea absorbs all of the free vertical space when the parel is resized?

     

     

     

    題目4: Which are not containers in Java?(Multiple answer)
    A ScollPane
    B Canvas
    C Scrollbar
    D Applet
    E Dialog


     

     

    題目5:You need to store elements in a collection that 
    guarantees that no duplicates are stored and all elements 
    can be access in nature order, which interface provides 
    that capability?

     

    A java.uil.Map
    B java.util.Collection
    C java.util.List
    D java.util.SortedSet
    E java.util.SortedMap
    F java.util.Set

     

     

     

    題目6:What will happen when you attempt to compile and run this 
    code?


    abstract class Base{
      abstract public void myfunc();
    public class Abs extends Base{
    public static void main(String argv[])
    {
      Abs a = new Abs();
      a.amethod();
    }
    public void amethod(){
      System.out.println("A method");;
    }
    }

    A The code will compile and run, printing out the words "A 
    method"
    B The compiler will complain errors in Base class.
    C The code will compile but complain at run time that the 
    Base class has none abstract methods.
    D The compiler will complain errors in Abs class

     

     

     

     

    題目7: Description
    import java.util.*;


    public class Test
    {
      private String value = null;
      public Test(String v)
      {
      value = v;
      }
      public boolean equals(Test o)
      {
      if(o==this) return true;
      if(o instanceof Test)
      {
      Test test =(Test) o;
      return value.equals(test.value);
      }
      return false;
      }
      public static void main(String[] args)
      {
      List list = new ArrayList();
      Test test1 = new Test("object");
      Test test2 = new Test("object");
      Test test3 = new Test("object");
      Object test4 = new Test("object");
      list.add(test1);

      System.out.println(list.contains(test2));
      System.out.println(test2.equals(test3));
      System.out.println(test3.equals(test4));

      }
    }


     

     

     

    題目8:
    Which of the following is NOT true regarding to RuntimeException?
    A RuntimeException is the superclass of those exceptions that can be thrown during the normal operation of the Java Virtul
    Machine.
    B A method is not required to declare in its throws clause any subclasses of RuntimeException that might be thrown during the

    execution of the method but not caught.
    C An RuntimeException is a subclass of Throwable that indicates serious problems that a reasonable application should not try
    to catch.
    D NullPointerException is one kind of RuntimeException.

     

     

     

     

    題目9: Which of the following items demonstrates the key characteristics of Web 2.0

    A Centralized
    B User centered design
    C Open
    D Light Weight

     

     

     

     

    題目10: When using the writeObject method to store the state of n  object, how can you protect sensitive data from being 
    accessed in the stored object?
    A Implement the Object as Exteralizable
    B Declare the sensitive fields as private transient
    C Declare the sensitive fields as static transient

    D Declare the sensitive fields as protected transient


    ----2009年01月22日
    posted on 2010-09-01 11:16 李 明 閱讀(303) 評論(0)  編輯  收藏 所屬分類: Java
    主站蜘蛛池模板: 999久久久免费精品国产| 亚洲Av无码一区二区二三区| 成人性生交视频免费观看| 国产猛男猛女超爽免费视频| 亚洲第一成年网站视频| 色婷五月综激情亚洲综合| 久久久久亚洲AV无码专区体验| 色噜噜亚洲精品中文字幕| 男人的天堂亚洲一区二区三区 | 日本不卡高清中文字幕免费| 日本视频一区在线观看免费| 国产精品99精品久久免费| 中文无码日韩欧免费视频| 免费一级特黄特色大片| 国产综合成人亚洲区| 亚洲欧美乱色情图片| 色噜噜亚洲男人的天堂| 亚洲天堂一区二区三区四区| 亚洲视频在线观看地址| 亚洲人成电影亚洲人成9999网| 久久久久亚洲精品成人网小说| 亚洲人成人网站色www| 久久亚洲色一区二区三区| 亚洲午夜爱爱香蕉片| 亚洲五月午夜免费在线视频| 亚洲精品第一国产综合境外资源| 免费在线观看中文字幕| 内射无码专区久久亚洲| 亚洲国产精品日韩专区AV| 亚洲国产主播精品极品网红 | 国产AV无码专区亚洲AV琪琪| 亚洲AV日韩AV无码污污网站| 亚洲国产综合AV在线观看| 在线91精品亚洲网站精品成人| 亚洲AV网一区二区三区| 免费大片av手机看片高清| 一个人看www免费高清字幕| 久久久久国色AV免费观看| 国产精品免费高清在线观看| 中文字幕免费观看| 久久久久国产精品免费免费搜索 |