1 / 13
文档名称:

惠普Java类笔试题.doc

格式:doc   大小:99KB   页数:13页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

惠普Java类笔试题.doc

上传人:蓝天 2021/10/28 文件大小:99 KB

下载得到文件列表

惠普Java类笔试题.doc

相关文档

文档介绍

文档介绍:JAVA部分
which are run-time exceptions() a,d,f,g,h
ArithmeticException
B .ClassNotFoundException
OutOfMemoryError
ClassCastException
In terruptedException
Illegal ArgumentException
GlndexOutOfB oundsException

Which Man class properly represents the relationship "Man has a best friend who is a DogH d
class Man extends Dog{}
class Man implements{}
class Man {private BestFriend dog;}
class Man {private Dog bestFriend;}
class Man {private Dog;}
class Man {private BestFriend;}
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
Cat is-a Aminal
Cat is-a Jumper
Dog is-a Animal
Dog is-a Jumper
Cat has-a Animal
Beagle has-a Tail
has-a Jumper
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){();}
B:public void add(B b){();}
C:public void add(A a){();}
D:public void add(A a,B b){();}
E:public void add(C cl,C c2){();}
丢失
Given B [2P]
String test = "This is test";
String[] tokens = ("¥s"); ();
whta is the result()
O
l
4
Compilation fails
An exception is thrown at runtime
Given: C
class Wow{
public static void go(short n){
(" short");
}
public static void go(Short n){
(nSHORTn);
}
public static void go(Long n){
("LONG");
}
public static void main(String[] args){
Short n = 6;
int m = 7;
go(n);
go(m);//这一句编译出错
}
}
Which is th result? ( ) [2P]
short LONG
SHORT LONG
Compilation fails
An exception is thrown at runtime
public class NamedCount