Java程序员认证模拟试题
来源:优易学  2011-11-28 13:07:11   【优易学:中国教育考试门户网】   资料下载   IT书店

 

26. Give following class:
class AClass{
private long val;
public AClass(long v){val=v;}
public static void main(String args[]){
AClass x=new AClass(10L);
AClass y=new AClass(10L);
AClass z=y;
long a=10L;
int b=10;
}
}
Which expression result is true?
A. a==b;
B. a==x;
C. y==z;
D. x==y;
E. a==10.0;

27. A socket object has been created and connected to a standard internet service on a remote network server. Which construction give the most suitable means for reading ASCII data online at a time from the socket?
A. InputStream in=s.getInputStream();
B. DataInputStream in=new DataInputstream(s.getInputStream());
C. ByteArrayInputStream in=new ByteArrayInputStream(s.getInputStream());
D. BufferedReader in=new BufferedReader(new InputStreamReader(s.getInputStream()));
E. BufferedReader in=new BufferedReader(new InputStreamReader(s.getInputStream()),”8859-1”);

28. String s=”Example String”;
Which operation is legal?
A. s>>>=3;
B. int i=s.length();
C. s[3]=”x”;
D. String short_s=s.trim();
E. String t=”root”+s;

29. What happens when you try to compile and run the following program?
class Mystery{
String s;
public static void main(String[] args){
Mystery m=new Mystery();
m.go();
}
void Mystery(){
s=”constructor”;
}
void go(){
System.out.println(s);
}
}
A. this code will not compile
B. this code compliles but throws an exception at runtime
C. this code runs but nothing appears in the standard output
D. this code runs and “constructor” in the standard output
E. this code runs and writes ”null” in the standard output

30. What use to position a Button in a Frame ,only width of Button is affected by the Frame size, which Layout Button well be set ?
A. FlowLayout;
B. GridLayout;
C. North of BorderLayout
D. South of BorderLayout
E. East or West of BorderLayout

31. What use to position a Button in a Frame, size of Button is not affected by the Frame size, which Layout Button will be set?
A. FlowLayout;
B. GridLayout;
C. North of BorderLayout
D. South of BorderLayout
E. East or West of BorderLayout

32. An AWT GUI under exposure condition, which one or more method well be invoke when it redraw?
A. paint();
B. update();
C. repaint();
D. drawing();

33. Select valid identifier of Java:
A. userName
B. %passwd
C. 3d_game
D. $charge E. this

34. Which are Java keyword?
A. goto
B. null
C. FALSE
D. native
E. const

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] 下一页

责任编辑:小草

文章搜索:
 相关文章
热点资讯
热门课程培训