java高级工程师笔试题
选择题
1:which is the main() method return of a application?
ng
2:
what will happen when you attempt to compile and run the following code?
int output = 10;
boolean b1 = false;
if((b1 true) && ((output += 10) 20))
{
tln("we are equal " + output);
}
else
{
tln("not equal! " + output);
}
choices:
what will happen when you attempt to compile and run the following code?
int output = 10;
boolean b1 = false;
if((b1 true) && ((output += 10) 20))
{
tln("we are equal " + output);
}
else
{
tln("not equal! " + output);
}
choices:
ilation error, attempting to perform binary comparison on logical data type
ilation and output of "we are equal 10".
ilation and output of "not equal! 20".
ilation and output of "not equal! 10".
3:
what will happen when you attempt to compile and run the following code?
class base
{
int i = 99;
public void amethod()
{
tln("hod()");
}
base()
{
amethod();
}
}
public class derived extends base
{
int i = -1;
public static void main(string argv[])
{
base b = new derived();
tln(b.i);
hod();
}
public void amethod()
{
tln("hod()");
}
}
choices:
what will happen when you attempt to compile and run the following code?
class base
{
int i = 99;
public void amethod()
{
tln("hod()");
}
base()
{
amethod();
}
}
public class derived extends base
{
int i = -1;
public static void main(string argv[])
{
base b = new derived();
tln(b.i);
hod();
}
public void amethod()
{
tln("hod()");
}
}
choices:
hod() -1 hod()
hod() 99
ile time error
hod()
4:
下述程序代码中有语法错误的行是( )。
int i,ia[10],ib[10]; /*第一行*/
for (i=0;i<=9;i++) /*第2行*/
ia[i]=0; /*第3行*/
ib=ia; /*第4行*/
下述程序代码中有语法错误的行是( )。
int i,ia[10],ib[10]; /*第一行*/
for (i=0;i<=9;i++) /*第2行*/
ia[i]=0; /*第3行*/
ib=ia; /*第4行*/
a.第1行
b.第2行
c.第3行
d.第4行
5:
what will be the result of executing the following code?
// filename;
package packagex;
public class superclassx
{
protected void superclassmethodx()
{
}
int superclassvarx;
}
// filename
age agey;
2.
ic class subclassy extends superclassx
4.{
rclassx objx = new subclassy();
lassy objy = new subclassy();
subclassmethody()
8.{
rclassmethodx();
i;
11.i = rclassvarx;
12.}
13.}
choices:
what will be the result of executing the following code?
// filename;
package packagex;
public class superclassx
{
protected void superclassmethodx()
{
}
int superclassvarx;
}
// filename
age agey;
2.
ic class subclassy extends superclassx
4.{
rclassx objx = new subclassy();
lassy objy = new subclassy();
subclassmethody()
8.{
rclassmethodx();
i;
11.i = rclassvarx;
12.}
13.}
choices:
ilation error at line 5
ilation error at line 9
ime exception at line 11
of these
6:which are not java keywords?
t
r
7: consider the class hierarchy shown below:
——————————————————————————————————
class fourwheeler implements drivingutilities
class car extends fourwheeler
class truck extends fourwheeler
class bus extends fourwheeler
class crane extends fourwheeler
———————————————————————————————————
consider the following code below:
ingutilities du;
wheeler fw;
k mytruck = new truck();
= (drivingutilities)mytruck;
= new crane();
= du;
which of the statements below are true?
choices:
4 will not compile because an interface cannot refer to an object.
code will compile and run.
code will not compile without an explicit cast at line 6, because going down the hierarchy without casting is not allowed.
code will compile if we put an explicit cast at line 6 but will throw an exception at runtime.
8:exhibit :
1. public class test (
2. private static int j = 0;
3.
4. private static boolean methodb(int k) (
5. j += k;
6. return true;
6. )
7.
8. public static void methoda(int i) {
9. boolean b:
10. b = i < 10 | methodb (4);
11. b = i < 10 || methodb (8);
12. )
13.
14. public static void main (string args[] } (
15. methoda (0);
16. tin(j);
17. )
18. )
what is the result?
program prints “0”
program prints “4”
program prints “8”
program prints “12”
9:
public class outerclass {
private double d1 = 1.0;
//insert code here
}
you need to insert an inner class declaration at line 3. which two inner class declarations are
valid?
public class outerclass {
private double d1 = 1.0;
//insert code here
}
you need to insert an inner class declaration at line 3. which two inner class declarations are
valid?
s innerone{ public static double methoda() {return d1;} }
ic class innerone{ static double methoda() {return d1;} }
ate class innerone{ double methoda() {return d1;} }
ic class innerone{ protected double methoda() {return d1;} }
10:
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
11:
string s=”example string”;which operation is not legal?
string s=”example string”;which operation is not legal?
i=th();
b.s[3]=”x”;
ng short_s=();
ng t=”root”+s;
12:软件生命周期的瀑布模型把软件项目分为3个阶段、8个子阶段,以下哪一个是正常的开发顺序?
a.计划阶段、开发阶段、运行阶段
b.设计阶段、开发阶段、编码阶段
c.设计阶段、编码阶段、维护阶段
d.计划阶段、编码阶段、测试阶段
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 class design requires that a member variable should be accessible only by same package, which modifer word should be used?
ected
ic
modifer
ate
15:
give the following method:
public void method( ){
string a,b;
a=new string(“hello world”);
b=new string(“game over”);
tln(a+b+”ok”);
a=null;
a=b;
tln(a);
}
in the absence of compiler optimization, which is the earliest point the object a refered is definitely elibile to be garbage collection.
give the following method:
public void method( ){
string a,b;
a=new string(“hello world”);
b=new string(“game over”);
tln(a+b+”ok”);
a=null;
a=b;
tln(a);
}
in the absence of compiler optimization, which is the earliest point the object a refered is definitely elibile to be garbage collection.
re line 5
re line 6
re line 7
re line 9
简答题
16:请阐述一下你对java多线程中“锁”的概念的理解。
17:列出jsp中包含外部文件的方式,两者有何区别。
18:请谈谈对一个系统设计的总体思路。针对这个思路,你觉得应该具备哪些方面的知识?
19:struts2中的拦截器,你用过那些自带的拦截器,自己写过的.吗?
20:怎样在复杂的各种形式的网页中提取mp3下载的结构化数据?
21:编写一个在二叉排序树中查找大小为第k的元素的算法。
22:java多线程编程。 用java写一个多线程程序,如写四个线程,二个加1,二个对一个变量减一,输出。
23:不允许使用系统时间,写出一个随机数生成函数。
24:hibernate中的id(主键)生成器有那些?或者你常用的是那些?
25:error和exception有什么区别?
-
男生面试西装忌讳
一、忌西裤短,标准的.西裤长度为裤管盖住皮鞋;二、忌衬衫放在西裤外;三、忌衬衫领子太大,领脖间存在空隙;四、忌领带颜色刺目;五、忌领带太短,一般领带长度应是领带尖盖住皮带扣;六、忌不扣衬衫扣就佩戴领带;七、忌西服上衣袖子过长,它应比衬衫袖短1厘米;八、忌西服的上衣...
-
洋考试催热国内培训 GRE、GMAT迎春季培训旺季
“烤鸡”、“考鸭”加“考托”,暗潮涌动的留学大军早已悄悄开始了新一轮的备战。记者走访深圳市多家提供出国考试培训项目的机构,得知大部分学生们都把这个寒假作为自己充电加油的好时机,希望在日益激烈的留学竞争中脱颖而出。深圳新东方的GRE培训课堂座无虚席...
-
面试,道不同不相为谋。
面试,是求职者走向职业生涯的第一步,而要闯过“面试”这道关,对于求职者来说,不仅要有出众的学识、多种的技能、引以为自豪的学历等等应当具备的基本面试能力外,而且还得具备面试技巧。记得几年前我在各面试,是求职者走向职业生涯的第一步,而要闯过“面试”这道关,对于...
-
咖啡师培训的诱惑
调配、制作咖啡也能成为一项专门的职业,而且手艺精湛的咖啡师月薪超过万元。4月底劳动和社会保障部向社会发布的第六批14个新职业中,咖啡师正式进入职业领域。目前国内所有涉外旅游指定星级宾馆、饭店都设有咖啡的专营场所,甲级写字楼、大专院校、大型商场、高档...