IBM Java面试必备:英文题目与答案解析

需积分: 10 3 下载量 124 浏览量 更新于2024-07-26 收藏 79KB DOC 举报
"这是一份关于IBM Java面试的文档,包含了多个英文问题和可能的答案,旨在测试面试者对Java编程语言及其概念的理解。" 在Java面试中,掌握基础概念和技术细节至关重要。以下是一些问题及其相关知识点的详细解释: 1. **What is Oracle?** Oracle是一家提供数据库管理系统和其他企业软件的公司,它也是Java开发工具和平台的主要供应商。 2. **What is the major difference between Oracle 8i and Oracle 9i?** Oracle 9i引入了许多新特性,如更快的数据存取速度,改进的网络功能,支持XML,以及对Internet应用程序的增强等。 3. **Tell me something about yourself.** 这个问题通常用于了解面试者的个人背景、经验及职业目标,与技术知识相关性较小。 4. **Please tell me about OOPs.** OOPs (Object-Oriented Programming System) 指的是面向对象编程,核心概念包括封装、继承、多态和抽象。 5. **What is single inheritance?** 单继承是指一个类只能直接继承自一个父类,这是Java早期版本的一个特性,但可以通过实现接口来模拟多重继承的效果。 6. **What is interface?** 接口是Java中定义方法但不提供具体实现的类型,它允许类实现多个接口以达到多重继承的效果。 7. **How to prove that an abstract class cannot be instantiated directly?** 抽象类不能被实例化,尝试直接创建抽象类的对象会导致编译错误。 8. **What is the difference between String and StringBuffer?** String是不可变的,一旦创建就无法修改;而StringBuffer是可变的,适合在多线程环境中进行字符串操作,因为它是线程安全的。 9. **What is immutable?** 不可变对象是指一旦创建,其状态就不能改变的对象,比如Java中的String。 10. **How to write a program using sorting algorithm?** 可以使用Java内置的Arrays.sort()方法或实现自定义排序算法,如快速排序、归并排序等。 11. **What is legacy API?** Legacy API指的是旧版或过时的API,它们可能仍然被使用,但可能不再被推荐或得到最新更新。 12. **What is a legacy interface?** 这可能指的是以前版本中定义的接口,现在可能已经被新的接口替代,但仍然需要支持以保持向后兼容性。 13. **What is the main difference between Java and C++?** Java是完全面向对象的,有垃圾回收机制,且不支持指针,而C++既支持面向过程也支持面向对象,需要手动管理内存。 这些问题涵盖了Java的基础知识、版本差异、面向对象概念以及API使用等多个方面,对于准备Java面试的求职者来说是很好的参考资料。
2008-12-21 上传
1. The name of a Java source file (a) has no restrictions (b) must be the same as the class it defines, ignoring case (c) must use the extension .class (d) must be the same as the class it defines, respecting case 2. Which of the following statements is (are) true about the use of an asterisk (*) in a Java import statement? Ⅰ.It does not incur run-time overhead. Ⅱ.It can be used to import multiple packages with a single statement. Ⅲ.It can be used to import multiple classes with a single statement (a) I, II, and III (b) I and III only (c) I only (d) III only ..... 9. According to the Java code conventions, files that contain Java source code have the suffix _____, and compiled bytecode files have the suffix _____. (a) .class, .java (b) .class, .javac (c) .java, .class (d) .javac, .class 10. As an aid in debugging a program in Java, print statements may be used to display which of the following types of information? I. The names of methods being called II. The values of the parameters of a method Ⅲ. The values of the instance variables of a class (a) I and II only (b) I and III only (c) II and III only (d) I, II, and III 1. In a UML class diagram's representation of a class, the top, middle, and lower rectangular compartments respectively describe the _____ of the class. (a) name, attributes, and methods (b) name, methods, and constants (c) attributes, methods, and name (d) attributes, methods, and constants 2. UML class diagrams can describe which of the following? I. The internal structure of classes Ⅱ. Relationships between classes (a) I and II (b) II only (c) None (d) I only ....... 1.The term class variable is a synonym for (a) a private data field (b) a static data field (c) a read-only variable (d) an instance variable 2. Consider the following Java program segment. import java.io.*; public class Test { public Test( ) { System.out.println("default"); } public Test( int i ) { System.out.println("non-default"); } public static void main(String[] args) { Test t = new Test(2); } } ......... 9. When a subclass defines an instance method with the same return type and signature as a method in its parent, the parent's method is said to be (a) private (b) hidden (c) overloaded (d) overridden 10. Which is a Java access modifier used to designate that a particular data field will not be inherited by a subclass? (a) final (b) protected (c) private (d) default 1. Consider the following Java program segment. String[] str = {"Three","Two","One"}; for (int i = 0; i < str.length; ++i) { System.out.println(str[i]+"/"); } What will be output upon execution of the program segment? (a) Three/Two/One/ (b) Three,Two,One (c) One,Two,Three (d) One/Two/Three/ 2. Consider the following Java program segment. int[] arr; arr = new int[3]; arr[2]=19; arr[1]=17; arr[0]=15; Which of the following Java statements is syntactically correct and semantically identical to the program segment? (a) int[] arr= {15, 17, 19}; (b) int[3] arr = {15, 17, 19}; (c) int arr = {15, 17, 19}; (d) int arr[3]= {15, 17, 19}; ........ 2. Which of the following statements is (are) true about any abstract method in Java? I. It contains no definition. Ⅱ. It cannot be declared public. (a) I and II (b) I only (c) None (d) II only 3. Consider the following Java program fragment. public void drive(Vehicle v) { ... } ... drive(obj); The method call drive(obj) is valid if obj is which of the following? I. A descendent of class Vehicle II. An ancestor of class Vehicle Ⅲ. An object of class Vehicle (a) I and III only (b) I, II, and III (c) III only (d) II and III only .....