08年底 Sybase的一套笔试题(java版)
来源:互联网 发布:php curl 选项 编辑:程序博客网 时间:2024/05/17 20:25
其实这博客是转论坛上的,
原帖:
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?
答:自己实现了一个,比较简单的。
- /**
- * @author bzwm
- *
- */
- public class BottleTest {
- public static void main(String[] args) {
- // 放空瓶子的栈
- java.util.Stack<Object> emptyBottles = new java.util.Stack<Object>();
- // 买的饮料数
- int bottle = 0;
- // 喝过饮料的人数
- int drink = 0;
- // 空饮料瓶子
- Object emptyBottle = new Object();
- while (drink < 27) {
- // 一个人喝过了
- drink++;
- // 把空瓶子放在栈中
- emptyBottles.push(emptyBottle);
- // 买的饮料数加1
- bottle++;
- // 如果空瓶子栈中的空瓶数为3个
- if (emptyBottles.size() == 3) {
- // 将三个瓶子拿去商店换饮料
- emptyBottles.pop();
- emptyBottles.pop();
- emptyBottles.pop();
- // 一个人喝过饮料
- drink++;
- // 将空瓶子再放在栈中
- emptyBottles.push(emptyBottle);
- }
- }
- System.out.println(bottle);
- }
- }
题目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
- 08年底 Sybase的一套笔试题(java版)
- 一套Java程序员笔试题
- 一套经典的笔试题
- 腾讯的一套笔试题
- Sybase的一套比试题-java版本-转载
- 一套不错的IOS笔试题选择题
- 一套关于 Django 的笔试题
- 一套C++笔试题
- 一套笔试题
- 一套笔试题
- 【收藏】一套基础的C语言笔试题
- 一套很不错的linux系统管理考试笔试自测题
- 一套很不错的linux系统管理考试笔试自测题
- Sybase c/c程序员的笔试题,2006-10
- 一套JAVA测试题
- 一套Java试题的解答
- 2014腾讯校招笔试题分析----数据结构篇(一套试题引发的血案)
- 一套SQL笔试题1、查找整个职员表的所有内容。select*fromemployees2、查看雇员
- 白皮书:当前大学生就业呈七大趋势
- TUXEDO的MAXACCESSERS详解
- 快过年了,奉上好玩游戏“劲爆弹球3”
- VC++中的数据类型
- C#电子邮件验证的类
- 08年底 Sybase的一套笔试题(java版)
- 25大软件编程错误不可赦
- aspjpeg 半透明描边的实现函数
- 飞鸽传书特大更新
- 基于DSP的数字图像处理(1)
- JAVAMAIL 发Email案例
- 简单常用JS函数集合大全107个
- TUXEDO SALT的连接控制
- 散列文件的插入、删除、查找和打印(C语言源代码)