没有合适的资源?快使用搜索试试~ 我知道了~
笔记达内java
需积分: 10 1 下载量 47 浏览量
2013-05-08
22:11:33
上传
评论
收藏 863KB PDF 举报
温馨提示
试读
90页
笔记达内java
资源推荐
资源详情
资源评论
1
Copyright Tarena Corporation,2009.All rights reserved
JAVASE 部分
1、Choose the three valid identifiers from those listed below. (Choose
three)?
A. IDoLikeTheLongNameClass
B. $byte
C. const
D. _ok
E. 3_case
答:ABD
2、Which of the following lines of code will compile without error (Choose
two)?
A.
int i=0;
if (i) {
System.out.println(“Hi”);
}
B.
boolean b=true;
boolean b2=true;
if(b==b2) {
System.out.println(“So true”);
}
C.
int i=1;
int j=2;
if(i==1|| j==2)
System.out.println(“OK”);
D.
int i=1;
int j=2;
if (i==1 &| j==2)
System.out.println(“OK”);
答:BC
3、Which two demonstrate a "has a" relationship(Choose two)?
A. public interface Person { }
public class Employee extends Person{ }
B. public interface Shape { }
public interface Rectandle extends Shape { }
C. public interface Colorable { }
public class Shape implements Colorable
{ }
D. public class Species{ }
2
Copyright Tarena Corporation,2009.All rights reserved
public class Animal{private Species species;}
E. interface Component{ }
class Container implements Component{
private Component[] children;
}
答:DE
4、What will happen when you attempt to compile and run the following code?
public class Static{
static {
int x = 5;
}
static int x,y;
public static void main(String args[]){
x--;
myMethod();
System.out.println(x + y + ++x);
}
public static void myMethod(){
y = x+++++x;
}
}
A.compiletime error
B.prints: 1
C.prints: 2
D.prints: 3
E.prints: 7
F.prints: 8
答:D
5 、 What is the correct ordering for the import, class and package
declarations when found in a single file?
A. package, import, class
B. class, import, package
C. import, package, class
D. package, class, import
答:A
6、What will happen when you attempt to compile and run the following code.
public class Pvf{
static boolean Paddy;
public static void main(String argv[]){
System.out.println(Paddy);
}
}
3
Copyright Tarena Corporation,2009.All rights reserved
A. Compile time error B. compilation and output of false
C. compilation and output of true D. compilation and output of null
答:B
7、Given the folowing classes which of the following will compile without
error?
interface IFace{}
class CFace implements IFace{}
class Base{}
public class ObRef extends Base{
public static void main(String argv[]){
ObRef ob = new ObRef();
Base b = new Base();
Object o1 = new Object();
IFace o2 = new CFace();
}
}
A. o1=o2; B. b=ob; C. ob=b; D. o1=b;
答:ABD
8、下面那几个函数是 public void method(){...}的重载函数?
A)public void method( int m){...} B)public int method(){...}
C)public void method2(){...} D)public int method(int m,float f ){...}
答:AD
9、给出如下声明:
String s = “Example”;
合法的代码有哪些?
A)s>>>=3 B)s[3]= “X” C)int i = s.length() D)s = s + 10
答:CD
10、如下哪些不是 java 的关键字?
A)const B)NULL C) false D)this E) native
答:B
11、关于垃圾收集的哪些叙述是对的
A)程序开发者必须自己创建一个线程进行内存释放的工作
B)垃圾收集将检查并释放不在使用的内存
C)垃圾收集允许程序开发者明确指定并立即释放该内存
D)垃圾收集能够在期望的时间释放被 java 对象使用的内存
答:B
12、已知表达式 int m [ ] = {0,1,2,3,4,5,6};
下面哪个表达式的值与数组下标量总数相等?
A)m.length() B)m.length C)m.length()+1 D)m.length-1
4
Copyright Tarena Corporation,2009.All rights reserved
答:D
13、方法 resume()负责恢复哪些线程的执行
A)通过调用 stop()方法而停止的线程。
B)通过调用 sleep()方法而停止的线程。
C)通过调用 wait()方法而停止的线程。
D)通过调用 suspend()方法而停止的线程。
答:D
14、有关线程的哪些叙述是对的
A)一旦一个线程被创建,它就立即开始运行。
B)使用 start()方法可以使一个线程成为可运行的,但是它不一定立即开始运
行。
C)当一个线程因为抢先机制而停止运行,它被放在可运行队列的前面。
D)一个线程可能因为不同的原因停止并进入可运行状态。
答:BCD
15、已知如下代码:
public class Test
{
long a[] = new long [10];
public static void main(String arg[] ){
System.out.print(a[6]);
}
}
请问哪个语句是正确的?
A)Output is null. B)Output is 0
C)When compile, some error will occur. D)When running, some error will
occur.
答:C
16、已知如下代码:
public class Test
{
public static void main(String arg[] )
{
int i = 5;
do{
System.out.print(i);
}while(--i>5);
System.out.print(“finished”);
}
}
执行后的输出是什么?
A)5 B)4 C)6 D)finished
5
Copyright Tarena Corporation,2009.All rights reserved
答:AD
17、已知如下代码:
switch (m)
{
case 0: System.out.print(“Condition 0”);
case 1: System.out.print(“Condition 1”);
case 2: System.out.print(“Condition 2”);
case 3: System.out.print(“Condition 3”);
default: System.out.print(“Other Condition ”);
}
当 m 的值为什么时能输出“Condition 2”
A)0 B)1 C)2 D)3 E) 4 F)None
答:ABC
18、下面的哪些声明是合法的?
A)long 1 = 4990 B)int i = 4L C)float f =1.1 D)double d = 34.4
答:AD
19、给出如下代码:
class Test{
private int m;
public static void fun() {
//some code„
}
}
如何使成员变量 m 被函数 fun()直接访问?
A)将 private int m 改为 protected int m B)将 private int m 改为 public
int m
C)将 private int m 改为 static int m D)将 private int m 改为 int m
答:C
20、以下哪个方法用于定义线程的执行体?
A)start() B)init() C)run() D)main() E)synchronized()
答:C
21、请看如下代码
class Person {
private int a;
public int change(int m) {
return m;
}
}
public class Teacher extends Person {
public int b;
剩余89页未读,继续阅读
资源评论
u010623480
- 粉丝: 0
- 资源: 8
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 毕业设计- 基于STM32F103C8T6 单片机,物联网技术的太阳能发电装置+源代码+文档说明+架构图+界面截图
- 基于 LSTM(长短期记忆)(即改进的循环神经网络)预测风力发电厂中风力涡轮机产生的功率+源代码+文档说明
- 基于stm32f103+空心杯电机+oled按键+运动算法
- 《CKA/CKAD应试指南/从docker到kubernetes 完全攻略》学习笔记 第1章docker基础(1.1-1.4)
- 基于python实现的水下压缩空气储能互补系统建模仿真与经济效益分析+源代码+论文
- 华中科技大学-自然语言处理实验,Bi-LSTM+CRF的中文分词框架,并且利用基于深度学习的方法进行中文命名实体识别++源码报告
- 基于动态罚函数的铁路车流分配与径路优化模型python源码
- 鱼群算法求解组环问题python源码+文档说明
- 基于决策优化的多波束测深测线规划模型MATLAB代码
- 课程设计-基于python实现的多目标优化算法求解带时间窗的车辆路径规划问题+源代码+文档说明+界面截图+pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功