JAVA系统分析笔试题
选择题
1:public class x{
public object m(){
object o = new float(3.14f);//line 3
object [] oa = new object[1];//line 4
oa[0] = o;//line 5
o=null;//line 6
return oa[0];//line 7
}
}
when is the float object, created in line 3,eligible for garbage collection?
public class x{
public object m(){
object o = new float(3.14f);//line 3
object [] oa = new object[1];//line 4
oa[0] = o;//line 5
o=null;//line 6
return oa[0];//line 7
}
}
when is the float object, created in line 3,eligible for garbage collection?
after line 5.
after line 6
after line 7(that is,as the method returns)
r in this method
2:use the operator “>>” and “>>>”. which statement is true?
a.1010 0000 0000 0000 0000 0000 0000 0000 >> 4 give 0000 1010 0000 0000 0000 0000 0000 0000
b.1010 0000 0000 0000 0000 0000 0000 0000 >> 4 give 1111 1010 0000 0000 0000 0000 0000 0000
c.1010 0000 0000 0000 0000 0000 0000 0000 >>> 4 give 0000 0000 0000 0000 0000 0000 0000 0000
d.1010 0000 0000 0000 0000 0000 0000 0000 >>> 4 give 1111 1010 0000 0000 0000 0000 0000 0000
3:the following code is entire contents of a file called ,causes precisely one error during compilation:
class subclass extends baseclass{
}
class baseclass(){
string str;
public baseclass(){
tln(“ok”);}
public baseclass(string s){
str=s;}}
public class example{
public void method(){
subclass s=new subclass(“hello”);
baseclass b=new baseclass(“world”);
}
}
which line would be cause the error?
the following code is entire contents of a file called ,causes precisely one error during compilation:
class subclass extends baseclass{
}
class baseclass(){
string str;
public baseclass(){
tln(“ok”);}
public baseclass(string s){
str=s;}}
public class example{
public void method(){
subclass s=new subclass(“hello”);
baseclass b=new baseclass(“world”);
}
}
which line would be cause the error?
a.9
b.10
c.11
d.12
4:what will be the result of executing the following code?
boolean a = true;
boolean b = false;
boolean c = true;
if (a == true)
if (b == true)
if (c == true) tln("some things are true in this world");
else tln("nothing is true in this world!");
else if (a && (b = c)) tln("it's too confusing to tell what is true and what is false");
else tln("hey this won't compile");
choices:
what will be the result of executing the following code?
boolean a = true;
boolean b = false;
boolean c = true;
if (a == true)
if (b == true)
if (c == true) tln("some things are true in this world");
else tln("nothing is true in this world!");
else if (a && (b = c)) tln("it's too confusing to tell what is true and what is false");
else tln("hey this won't compile");
choices:
code won't compile
b."some things are true in this world" will be printed
c."hey this won't compile" will be printed
of these
5:give the following java source fragement:
//point x
public class interesting{
//do something
}
which statement is correctly java syntax at point x?
give the following java source fragement:
//point x
public class interesting{
//do something
}
which statement is correctly java syntax at point x?
ic class myclass{//do other thing…}
ic int pi=3.14
s myclass{//do something…}
6:public class parent {
int change() {…}
}
class child extends parent {
}
which methods can be added into class child?
ic int change(){}
ract int chang(){}
ate int change(){}
7:给出下面的代码片断。。。下面的哪些陈述为错误的?
1) public void create() {
2) vector myvect;
3) myvect = new vector();
4) }
给出下面的代码片断。。。下面的哪些陈述为错误的?
1) public void create() {
2) vector myvect;
3) myvect = new vector();
4) }
a.第二行的声明不会为变量myvect分配内存空间。
b.第二行语句创建一个vector类对象。
c.第三行语句创建一个vector类对象。
d.第三行语句为一个vector类对象分配内存空间
8:what is written to the standard output given the following statement:tln(4|7);
select the right answer:
a.4
b.5
c.6
d.7
9:which fragments are not correct in java source file?
age testpackage; public class test{//do something...}
rt .*; package testpackage; public class test{// do something...}
rt .*; class person{// do something...} public class test{// do something...}
rt .*; import .*; public class test{// do something...}
10:give the following java class:
public class example{
static int x[]=new int[15];
public static void main(string args[]){
tln(x[5]);
}
}
which statement is corrected?
give the following java class:
public class example{
static int x[]=new int[15];
public static void main(string args[]){
tln(x[5]);
}
}
which statement is corrected?
compile, some error will occur.
run, some error will occur.
ut is zero.
ut is null.
11:使用 jdbc 可以做到的是
a.把二进制代码传送到任何关系数据库中
b.把 java 源代码传送到任何关系数据库中
c.把表单信息传送到任何关系数据库中
d.很容易地把 sql 语句传送到任何关系数据库中
12:which method you define as the starting point of new thread in a class from which new the thread can be excution?
ic void start()
ic void run()
ic void runnable()
ic static void main(string args[])
13:which statements about java code security are not true?
bytecode verifier loads all classes needed for the execution of a program.
uting code is performed by the runtime interpreter.
runtime the bytecodes are loaded, checked and run in an interpreter.
class loader adds security by separating the namespaces for the classes of the local file system from those imported from network sources.
14:关于垃圾收集的哪些叙述是对的。
a.程序开发者必须自己创建一个线程进行内存释放的工作。
b.垃圾收集将检查并释放不再使用的内存。
c.垃圾收集允许程序开发者明确指定并立即释放该内存。
d.垃圾收集能够在期望的时间释放被java对象使用的内存。
15:give the following java class:
public class example{
public static void main(string args[]){
static int x[] = new int[15];
tln(x[5]);
}
}
which statement is corrected?
give the following java class:
public class example{
public static void main(string args[]){
static int x[] = new int[15];
tln(x[5]);
}
}
which statement is corrected?
compile, some error will occur.
run, some error will occur.
ut is zero.
ut is null.
16:select valid identifier of java:
select valid identifier of java:
a.%passwd
b.3d_game
c.$charge
简答题
17:abstract class和interface有什么区别?
18:hibernate中,什么情况下,对象的状态可以由持久的变为托管的?
19:两个数相乘,小数点后位数没有限制,请写一个高精度算法。
20:求符合指定规则的数。
给定函数d(n) = n n的各位之和,n为正整数,如 d(78) = 78 7 8=93。 这样这个函数
可以看成一个生成器,如93可以看成由78生成。
定义数a:数a找不到一个数b可以由d(b)=a,即a不能由其他数生成。现在要写程序,找出
1至10000里的所有符合数a定义的数。
输出:
1
3
…
-
中国信保笔试经验谈
一、中英互译(一)英翻中1、马来西亚移通讯市场情况2、保险承保合同内容(二)中翻英1、中非合作论坛,ms新闻稿(很长)2、(记不清了)(三)英语作文拒绝客户投保请求的英文信二、选择题:k1、单选(5题)涉及汇率、国贸、经济、法律2、不定选(ms10题)涉及国贸术语、法律...
-
职业道德个人表现试题
在每天上班的路上,我的心情通常是()(a)沉闷的(b)轻松的(c)焦虑的(d)平静的如果有重新选择职业的可能,我()(a)还会选择现在的单位(b)基本上还会选择现在的单位(b)对这个问题关注不多(d)不会再选择现在这个单位我之所以在目前这个单位工作,是因为()。(a)这个单位的工资待遇还可以(b)这个单位与...
-
中信银行笔试经验分享大纲
我今天去笔了中信,因为没有报央行那么高大上的银行。总共三小时,2小时机考,1小时性格测试(分成6各部分,有性格测试,有一些简单的图形推理和图表算术)60个单项,20个多项(少选0.5分哦~我看到这个愣是把之前的一些选项勾没了o(∩_∩)o~)还有4*5英语阅读理解(蛮简...
-
大连笔试的,攒点rp
本人是11.3大连交大下午4点考试的同学。以前都是看其他同学提供的信息,真是谢谢大家,现在自己也可以回馈一下了。要依邮件的要求带好所需物品(其实,啥笔都行,就是用来在草纸上算算数的,是机考)在候考的时候,很nice的hrjj问我邮件两个通知都收到没,还说今年他们第一次短...