亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb

首頁 > 學院 > 開發設計 > 正文

非常不錯的SCJP真題回憶

2019-11-18 11:47:34
字體:
來源:轉載
供稿:網友

  PART 1
  
  1.public static void main(String args[]) {
  Boolean a[]=new Boolean[4];
  int I= 1;
  System.out.PRintln(a[I]); }
  What will be printed?
  Compilation Error in Line 2
  Compilation Error in line 4
  Exception in Line 4
  Will print true
  Will print false
  Will print null
  
  Ans:F
  2.
  public static void main(String args[]) {
  Integer b= new Integer(10);
  Add(b);
  System.out.println(b.intvalue());
  }
  void Add(Integer b)
  {
  int I= b.intvalue();
  I+=3;
  b= new Integer(I)
  }
  
  What will be printed out?
  
  Will print 13
  Will print 10
  Compilation Error in Line 4 ?. implicit conversion to Integer to
  String is not possible
  Compilation Error in line 10 you can't re initialize a Wrapper
  class
  Exception in Line 10
  Ans:b
  
  class text{
  public static void main(String args[])
  {
  String a =args[1];
  String b =args[2];
  String c =args[3];
  }
  }
  if you will execute java text cat dog sheep what will be the value of
  the 'c' ?
  cat
  dog
  sheep
  Compilation Error
  Exception will occur
  Ans:E
  
  4. public static void main(String args[])
  {
  Float f=new Float(4.2f);
  Float c;
  Double d=new Double(4.2);
  float fl=4.2f;
  c=f;
  }
  which will return true?. Select all
  f.equls(d)
  c==f
  c==d
  c.equls(f)
  
  Ans:B,D
  
  5. public static void main(String args[])
  {
  String s;
  System.out.println("s = "+s);
  }
  what will be printed out?
  Compilation Error
  An Exception will occur
  Will print s= null
  Will print s=
  
  Ans:A
  6. class s extends Thread{int j=0;
  public void run() {
  try{Thread.sleep(5000);}
  catch(Exception e){}
  
  j=100;
  }
  public static void main(String args[])
  {
  s t1=new s();
  t1.start();
  System.out.println(t1.j);
  }
  }
  
  what you have to do to ensure that 'j' will print 100
  
  you have make t1 as Daemon Thread
  You have join the t1 to main
  You have to suspend the main when the thread starts and resume it after
  the value of 'j' is set to 100
  You have to interrupt the main thread
  
  Ans:B
  7. What will happen if you compile/run this code?
  
  1: public class Q1 implements Runnable
  2: {
  3: public void run(String s)
  4: {
  5: System.out.println("Before start Thread :"+s);
  6:
  7: System.out.println("After stop of Thread :"+s);
  8: }
  9:
  10: public static void main(String[] args)
  11: {
  12: Q1 a = new Q1();
  13: Thread t=new Thread(a);
  14: t.start();}
  15: }
  
  A) Compilation error at line 1
  B) Runtime exception at line 13.
  C) Compilation error at line 14
  D) Prints "Before start of Thread "
  After Start of Thread
  
  Ans:A
  8. class s implements Runnable{
  int x=0,y=0;
  int addX(){x++; return x;}
  int addY(){y++; return y;}
  
  public void run()
  {
  for(int i=0;i<10;i++)
  System.out.println(addX()+""+addY());
  }
  
  public static void main(String args[])
  {
  s run=new s();
  Thread t1=new Thread(run);
  Thread t2=new Thread(run);
  t1.start();
  t2.start();
  }
  }
  
  Compile time Error There is no start method
  Will print in this order 11 22 33厖
  Will print but not exactly in an order (eg: 123124 3厖)
  Will print in this order 12 3厖123厖
  Will print in this order 123厖?.
  
  Ans:C
  9.
  class s implements Runnable{
  int x=0,y=0;
  synchronized void addX(){x++; }
  synchronized void addY(){y++; }
  void addXY(){x++;y++;}
  boolean check() { return (x>y)? true:false;)
  
  public void run()
  {
  ////
  System.out.println(check()); }
  public static void main(String args[])
  { s run=new s();
  Thread t1=new Thread(run);
  Thread t2=new Thread(run);
  t1.start();
  t2.start();
  }
  }
  If this methods are called in which order the check will return true?
  Select all that apply
  call addX() and addY() simultaneously for number of times in run()
  call addY() and addX() simultaneously for number of times in run()
  all addXY() for number of times in run()
  
  Ans:B,C
  
  10. What is the name of the method used to start a thread execution?
  A. init();
  B. start();
  C. run();
  D. resume();
  Ans:B
  
  11. Which two methods may not directly cause a thread to stop
  executing?
  A. sleep();
  B. stop();
  C. yield();
  D. wait();
  E. notify();
  F. notifyAll()
  G. synchronized()
  Ans:EF
  
  12. class Outer{
  class Inner{}
  }
  How will you create an instance of Inner Class out side? Select 2
  Inner a= new Inner();
  Outer o= new Outer();Inner a= new o.Inner();
  Outer o= new Outer();Outer.Inner a= new o.Inner();
  Outer.Inner a= new Outer().new Inner();
  Ans:CD
  
  13. What a static inner class can access select one
  A. Any variables in the enclosing scope
  B. Final variables in the enclosing scope
  C. Static variables declared in side the method
  D. Static variables declared in side the outer class
  Ans:D
  
  14. What is true about inner class? Select one
  an Inner class can access all variables in the any enclosing scope
  an Inner class can access all variables in the enclosing scope
  an inner class can be declared as private
  an Anonymous inner class can be extended from class and can implement
  an interface
  
  Ans:C
  
  15. A ----- is a class that is a collection which cannot contain any
  duplicate elements which maintains its elements in ascending order.
  SortedSet
  Set
  Sorted Map
  Collection
  TreeSet
  
  Ans: A
  
  16. What is true about Map select one
  A map will order the elements in an order according the key
  A map will use unique key to store value
  A map will use unique key to identify value inside the map
  Ans:C
  17. Which Method Returns the parent part of the pathname of this File
  object, or null if the name has no parent part?
  getParent()
  getParentDir()
  getParentDirectory()
  parentDirectory()
  
  Ans:a
  
  18. Which class should be used in situations that require writing
  characters rather than bytes.
  LineNumberWriter
  PrintWriter
  PrintStream
  PrintOutputReader
  Ans:B
  
  19. To Write End of a File f=new File(C://hello.txt");
  new RandomAccessFile(f,"rw").writeByte(?;
  FileInputStream fis=new FileInputStream(f,true);
  DataInputStream d=new DatainputStream(fis);
  d.writeBytes(?
  FilterInputStream fis=new FilterInputStream(f,true);
  DataInputStream d=new DatainputStream(fis);
  d.writeBytes(?
  D. FileOutputStream fis=new FileOutputStream(f);
  DataOutputStream d=new DataOutputStream(fis);
  d.writeBytes(?
  E

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb
亚洲福利视频专区| 日韩免费在线免费观看| 午夜精品一区二区三区av| 日韩视频免费在线| 亚洲一区二区三区四区视频| 欧美午夜丰满在线18影院| 91久久精品国产91久久| 日韩精品www| 国产在线精品成人一区二区三区| 久久国产精品99国产精| 亚洲高清久久久久久| 久久久久久久色| 国产精品欧美激情在线播放| 国产精品吊钟奶在线| 狠狠躁夜夜躁人人爽天天天天97| 国产欧美精品在线| 4k岛国日韩精品**专区| 中国china体内裑精亚洲片| 亚洲精品久久久久中文字幕二区| 国产精品久久久91| 日本在线观看天堂男亚洲| 91在线免费网站| 久久影视电视剧免费网站清宫辞电视| 成人av.网址在线网站| 亚洲色图色老头| 精品人伦一区二区三区蜜桃免费| 亚洲欧美中文在线视频| 中文字幕自拍vr一区二区三区| 国产在线a不卡| 热久久这里只有| 中文字幕日韩欧美在线| 一区二区福利视频| 成人免费自拍视频| 欧美黑人国产人伦爽爽爽| 欧美黄色免费网站| 久久精品电影一区二区| 91久久精品一区| 国产精品pans私拍| 亚洲欧洲在线免费| 亚洲欧美日韩爽爽影院| 国产在线观看精品一区二区三区| 色悠久久久久综合先锋影音下载| 国产精品成人国产乱一区| 91高清视频在线免费观看| 国模视频一区二区| 国产又爽又黄的激情精品视频| 中文字幕日韩精品在线| 55夜色66夜色国产精品视频| 日日狠狠久久偷偷四色综合免费| 久久久久www| 9.1国产丝袜在线观看| 51久久精品夜色国产麻豆| 26uuu亚洲伊人春色| 国产亚洲欧洲高清| 亚洲电影中文字幕| 欧美一区二三区| 国产香蕉精品视频一区二区三区| 国产欧美日韩精品专区| 2018日韩中文字幕| 91久久久久久久久久久久久| 亚洲一二三在线| 久久久久久久久国产精品| 国产精品福利在线观看网址| 国产va免费精品高清在线| 中文字幕亚洲专区| 成人有码在线播放| 97碰在线观看| 亚洲国产精品电影在线观看| 免费99精品国产自在在线| 国产日韩综合一区二区性色av| 日韩亚洲国产中文字幕| 成人有码在线播放| 久久免费精品视频| 欧美电影《睫毛膏》| 欧美成人精品在线视频| 97久久精品人搡人人玩| 91精品视频免费观看| 91精品久久久久久久久| 久久99精品久久久久久青青91| 在线观看精品国产视频| 日韩不卡在线观看| 国产剧情日韩欧美| 精品日韩美女的视频高清| 成人性生交大片免费看视频直播| 91久热免费在线视频| 欧美黑人视频一区| 欧美在线观看网站| 欧洲中文字幕国产精品| 久久久久久久国产精品视频| 久久国产色av| 国产精品美女网站| 欧美日韩免费观看中文| 91免费在线视频网站| 国产一区二区免费| 欧美中文在线字幕| 亚洲女人被黑人巨大进入al| 92版电视剧仙鹤神针在线观看| 疯狂蹂躏欧美一区二区精品| 国产成人涩涩涩视频在线观看| 成人h猎奇视频网站| 国产成人精品久久久| 91精品久久久久久综合乱菊| 欧美极品xxxx| 欧美日韩亚洲精品内裤| 91在线视频成人| 亚洲小视频在线观看| 狠狠躁夜夜躁人人躁婷婷91| 一区二区三区高清国产| 亚洲九九九在线观看| 欧美www在线| 国产在线观看91精品一区| 97超级碰碰碰久久久| 亚洲人午夜精品免费| 日韩美女福利视频| 亚洲精品成a人在线观看| 欧美黄色免费网站| 91在线视频九色| 亚洲精品国产精品国产自| 久久久久国产精品免费| 欧美亚洲在线观看| 亚洲欧美激情视频| 久久久国产精品一区| 久久成人在线视频| 最近的2019中文字幕免费一页| 亚洲女性裸体视频| 狠狠爱在线视频一区| 国产精品扒开腿爽爽爽视频| 成人久久18免费网站图片| 中文字幕日韩欧美在线视频| 色综合影院在线| 国产精品久久久久国产a级| 精品一区二区三区电影| 欧美激情精品在线| 欧美在线一区二区三区四| 国内外成人免费激情在线视频| 亚洲精品国精品久久99热一| 久久久久久亚洲精品中文字幕| 欧美老女人xx| 亚洲人成自拍网站| 91欧美激情另类亚洲| 日本精品视频在线播放| 夜夜狂射影院欧美极品| 欧美高清第一页| 亚洲人成电影网| 高清欧美性猛交xxxx黑人猛交| 国产日产欧美a一级在线| 最近2019中文字幕一页二页| 一区二区三区高清国产| 亚洲夜晚福利在线观看| 亚洲人成77777在线观看网| 中文字幕免费精品一区高清| 热门国产精品亚洲第一区在线| 亚洲二区中文字幕| 在线国产精品播放| 国产美女久久精品| 国产91色在线播放| 中文字幕日韩综合av| 欧美电影在线免费观看网站| 清纯唯美日韩制服另类| 日韩精品福利在线| 国产精品视频26uuu| 亚洲人成电影网站色www| 日韩在线精品视频| 国产精品一区二区性色av|