- 1、本文档共7页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
GD:惠普Java类笔试题
JAVA部分
1.which are run-time exceptions() a,d,f,g,h
A.ArithmeticException
B.ClassNotFoundException
C.OutOfMemoryError
D.ClassCastException
E.InterruptedException
F.IllegalArgumentException
G.IndexOutOfBoundsException
H.NullPointException
2.Which Man class properly represents the relationship Man has a best friend who is a Dog d
A.class Man extends Dog{}
B.class Man implements{}
C.class Man{private BestFriend dog;}
D.class Man{private Dog bestFriend;}
E.class Man{private Dog;}
F.class Man{private BestFriend;}
3 Given: b,c,f
interface Jumper{public void jump();}
class Animal{}..
class Dog extends Animal{Tail tail;}
class Beagle extends Dog implements Jumper{public void jump(){}}..
class Cat implements Jumper(public void jump(){}}
Which are true( )
Multiple choices
A.Cat is-a Aminal
B.Cat is-a Jumper
C.Dog is-a Animal
D.Dog is-a Jumper
E.Cat has-a Animal
F.Beagle has-a Tail
H.Beagle has-a Jumper
4 Given: a,b,c,d,e
interface A{public int getValue();}
class B implements A{public int getValue(){return 1;}}
class C extends B{ 15 :insert code in here}
Which three code frgments,inserted individaully at line 15,make use
(多选)
A:public void add(C c){c.getValue();}
B:public void add(B b){b.getValue();}
C:public void add(A a){a.getValue();}
D:public void add(A a,B b){a.getValue();}
E:public void add(C c1,C c2){c1.getValue();}
5.丢失
6.Given B [2P]
String test = This is test;
String[] tokens = test.split(¥s);
System.out.println(tokens.length);
whta is the result( )
A.0
B.1
C.4
D.Compilation fails
E.An exception is thrown at runtime
7. Given: C
class Wow{
public static void go(short n){
System.out.print(short);
}
public static void go(Short n){
System.out.print(SHORT);
}
public static void go(Long n){
System.out.print(LONG);
}
public static void main(String[] args){
Short n = 6;
int m = 7;
go(n);
go(m);//这一句编译出错
}
}
Which is th result? ( ) [2P]
A. short LONG
B. SHORT LONG
C. Compilation fails
D.An exception is thrown
文档评论(0)