当前位置:首页 > 全部子站 > IT > 思科认证

非常不错的SCJP真题回忆

来源:长理培训发布时间:2017-12-13 15:23:42

 百度广告

PART 1
Boolean a=new Boolean; 
System.out.println(a[I]); } 
Compilation Error in Line 2 
Exception in Line 4 
Will print false 
Ans:F 
Integer b= new Integer(10); 
System.out.println(b.intvalue()); 
void Add(Integer b) 
int I= b.intvalue(); 
b= new Integer(I) 
What will be printed out? 
Will print 10 
String is not possible 
class 
Ans:b 
public static void main(String args) 
String a =args[1]; 
String c =args; 

the 'c' ? 
dog 
Compilation Error 
Ans:E 

Float c; 
float fl=4.2f; 

f.equls(d) 
c==d 
Ans:B,D 

System.out.println("s = "+s); 
what will be printed out? 
An Exception will occur 
Will print s= 
6. class s extends Thread{int j=0; 
try{Thread.sleep(5000);} 
j=100; 
public static void main(String args) 
s t1=new s(); 
System.out.println(t1.j); 

you have make t1 as Daemon Thread 
You have to suspend the main when the thread starts and resume it after 
You have to interrupt the main thread 
7. What will happen if you compile/run this code? 
2: { 
4: { 
6: 
8: } 
10: public static void main(String args) 
12: Q1 a = new Q1(); 
14: t.start();} 
||| 
B) Runtime exception at line 13. 
D) Prints "Before start of Thread " 
Ans:A 
int x=0,y=0; 
int addY(){y++; return y;} 

System.out.println(addX()+""+addY()); 
public static void main(String args) 
s run=new s(); 
Thread t2=new Thread(run); 
t2.start(); 

Will print in this order 11 22 33厖 
Will print in this order 12 3厖123厖 
Ans:C 
class s implements Runnable{ 
synchronized void addX(){x++; } 
void addXY(){x++;y++;} 
y)? true:false;) 

System.out.println(check()); } 
{ s run=new s(); 
Thread t2=new Thread(run); 
t2.start(); 

Select all that apply 
call addY() and addX() simultaneously for number of times in run() 
Ans:B,C 
A. init(); 
C. run(); 
Ans:B 
executing? 
B. stop(); 
D. wait(); 
F. notifyAll() 
Ans:EF 
12. class Outer{ 

Inner a= new Inner(); 
Outer o= new Outer();Outer.Inner a= new o.Inner(); 
Ans:CD 
A. Any variables in the enclosing scope 
C. Static variables declared in side the method 
Ans:D 
an Inner class can access all variables in the any enclosing scope 
an inner class can be declared as private 
an interface 
15. A ----- is a class that is a collection which cannot contain any 
SortedSet 
Sorted Map 
TreeSet 
16. What is true about Map select one 
A map will use unique key to store value 
Ans:C 
object, or null if the name has no parent part? 
getParentDir() 
parentDirectory() 
18. Which class should be used in situations that require writing 
LineNumberWriter 
PrintStream 
Ans:B 
new RandomAccessFile(f,"rw").writeByte(?; 
DataInputStream d=new DatainputStream(fis); 
FilterInputStream fis=new FilterInputStream(f,true); 
d.writeBytes(? 
DataOutputStream d=new DataOutputStream(fis); 

责编:罗莉

发表评论(共0条评论)
请自觉遵守互联网相关政策法规,评论内容只代表网友观点,发表审核后显示!

国家电网校园招聘考试直播课程通关班

  • 讲师:刘萍萍 / 谢楠
  • 课时:160h
  • 价格 4580

特色双名师解密新课程高频考点,送国家电网教材讲义,助力一次通关

配套通关班送国网在线题库一套

课程专业名称
讲师
课时
查看课程

国家电网招聘考试录播视频课程

  • 讲师:崔莹莹 / 刘萍萍
  • 课时:180h
  • 价格 3580

特色解密新课程高频考点,免费学习,助力一次通关

配套全套国网视频课程免费学习

课程专业名称
讲师
课时
查看课程
在线题库
面授课程更多>>
图书商城更多>>
在线报名
  • 报考专业:
    *(必填)
  • 姓名:
    *(必填)
  • 手机号码:
    *(必填)
返回顶部