- 一级建造师考试
- 二级建造师考试
- 三支一扶
- 安全评价师考试
- 保险经纪资格考试
- 报关员资格考试
- 博士入学考试
- 成人高考
- 成人英语三级考试
- 程序员考试
- 出版专业资格考试
- 大学英语三级
- 大学英语四六级考试
- 单证员考试
- 导游证考试
- 电气工程师
- 电子商务设计师考试
- 房地产经纪人考试
- 房地产评估师考试
- 高级会计师资格考试
- 高考
- 高中会考
- 给排水工程师
- 公共英语等级考试
- 公务员考试
- 国际货运代理
- 国际内审师
- 国家司法考试
- 化工师
- 环境影响评价师
- 会计人员继续教育
- 会计职称考试
- 基金从业资格
- 计算机等级考试
- 计算机软件水平考试
- 监理工程师考试
- 教师招聘
- 教师资格
- 结构工程师考试
- 经济师考试
- 考研
- 空姐招聘
- 遴选
- 美术高考
- 普通话考试
- 期货从业资格
- 求职招聘
- 人力资源管理师
- 软件设计师考试
- 商务英语考试(BEC)
- 社会工作者职业水平考试
- 审计师考试
- 事业单位招聘
- 事业单位招聘
- 数据库系统工程师
- 特许公认会计师(ACCA)
- 同等学力
- 统计师考试
- 托福考试(T0EFL)
- 外贸跟单员考试
- 网络工程师考试
- 网络管理员考试
- 网络规划设计师考试
- 系统分析师考试
- 消防工程师
- 小升初
- 校园招聘
- 信息系统管理工程师考试
- 选调生考试
- 雅思考试
- 岩土工程师考试
- 医生招聘
- 艺术高考(艺考)
- 银行从业人员资格
- 银行招聘
- 英语翻译资格考试
- 营销师考试
- 造假工程师考试
- 证券从业资格考试
- 中考
- 注册安全工程师考试
- 注册测绘师考试
- 注册城市规划师考试
- 注册环保工程师考试
- 注册会计师考试
- 注册计量师考试
- 注册建筑师考试
- 注册税务师考试
- 注册资产评估师
- 专升本考试
- 专业英语四级八级考试
- 自考
- 安全员
- 跟单员
- 考试一本通
- 其它资料
上海德邦物流股份有限公司招聘 java 面试真题
一、选择题(20) [含多选]。(请在正确的答案上打”√”)
Question 1)
Which of the following statements are true?
1) An interface can only contain method and not variables
2) Interfaces cannot have constructors
3) A class may extend only one other class and implement only one interface
4) Interfaces are the Java approach to addressing its lack of multiple inheritance, but requ
ire implementing classes to create the functionality of the Interfaces.
Question 2)
Which of the following statements are true?
1) The garbage collection algorithm in Java is vendor implemented
2) The size of primitives is platform dependent
3) The default type for a numerical literal with decimal component is a float.
4) You can modify the value in an Instance of the Integer class with the setValue method
Question 3)
Which of the following are true statements?
1) I/O in Java can only be performed using the Listener classes
2) The RandomAccessFile class allows you to move directly to any point a file.
3) The creation of a named instance of the File class creates a matching file in the underl
ying operating system only when the close method is called.
4) The characteristics of an instance of the File class such as the directory separator, dep
end on the current underlying operating system
Question 4)
What will happen when you attempt to compile and run the following code
class Base{
public void Base(){
System.out.println(“Base”);}}
public class In extends Base{
public static void main(String argv[]){
In i=new In();}}
1) Compile time error Base is a keyword
2) Compilation and no output at runtime
3) Output of Base
4) Runtime error Base has no valid constructor
Question 5)
You have a public class called myclass with the main method defined as follows
public static void main(String parm[]){
System.out.println(parm[0]);}
If you attempt to compile the class and run the program as follows
java myclass hello
What will happen?
1) Compile time error, main is not correctly defined
2) Run time error, main is not correctly defined
3) Compilation and output of java
4) Compilation and output of hello
Question 6)
Which of the following statements are NOT true?
1) If a class has any abstract methods it must be declared abstract itself.
2) When applied to a class, the final modifier means it cannot be sub-classed
3) All methods in an abstract class must be declared as abstract
4) transient and volatile are Java modifiers
Question 7)
What will happen when you attempt to compile and run the following class?
class Base{
Base(int i){
System.out.println(“Base”);
}
}
class Severn extends Base{
public static void main(String argv[]){
Severn s = new Severn();
}
void Severn(){
System.out.println(“Severn”);
}
}
1) Compilation and output of the string ”Severn” at runtime
2) Compilation and no output at runtime
3) Compile time error
4) Compilation and output of the string ”Base”
Question 8)
Which of the following statements are true?
1) Static methods cannot be overriden to be non static
2) Static methods cannot be declared as private
3) Private methods cannot be overloaded
4) An overloaded method cannot throw exceptions not checked in the base class
Question 9)
Which of the following statements are true?
1) The automatic garbage collection of the JVM prevents programs from ever running out
of memory
2) A program can suggest that garbage collection be performed but not force it
3) Garbage collection is platform independent
4) An object becomes eligible for garbage collection when all references denoting it are s
et to null.
Question 10)
Given the following code
public class Sytch{
int x=2000;
public static void main(String argv[]){
System.out.println(“Ms ”+argv[1]+”Please pay $”+x);
}
}
What will happen if you attempt to compile and run this code with the command line
java Sytch Jones Diggle
1) Compilation and output of Ms Diggle Please pay $2000
2) Compile time error
3) Compilation and output of Ms Jones Please pay $2000
4) Compilation but runtime error
Question 11)
You need to read in the lines of a large text file containing tens of megabytes of data. Whic
h of the following would be most suitable for reading in such a file
1) new FileInputStream(“file.name”)
2) new InputStreamReader(new FileInputStream(“file.name”))
3) new BufferedReader(new InputStreamReader(new FileInputStream(“file.name”)));
4) new RandomAccessFile raf=new RandomAccessFile(“myfile.txt”,”+rw”);
Question 12)
Which of the following statements are true?
1) Constructors cannot have a visibility modifier
2) Constructors are not inherited
3) Constructors can only have a primitive return type
4) Constructors can be marked public and protected, but not private
Question 13)
Which statement is true?
1)An anonymous inner class
2)An anonymous inner class
3)An anonymous inner class
4)An anonymous inner class
may be declared as final.
can be declared as private.
can implement multiple interfaces .
can access final variables in any enclosing scope.
温馨提示:当前文档最多只能预览 4 页,此文档共9 页,请下载原文档以浏览全部内容。如果当前文档预览出现乱码或未能正常浏览,请先下载原文档进行浏览。
发表评论(共0条评论)
下载需知:
1 该文档不包含其他附件(如表格、图纸),本站只保证下载后内容跟在线阅读一样,不确保内容完整性,请务必认真阅读
2 除PDF格式下载后需转换成word才能编辑,其他下载后均可以随意编辑修改
3 有的标题标有”最新”、多篇,实质内容并不相符,下载内容以在线阅读为准,请认真阅读全文再下载
4 该文档为会员上传,版权归上传者负责解释,如若侵犯你的隐私或权利,请联系客服投诉
点击加载更多评论>>