日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

java scjp 试题_JAVA认证:78道SCJP考试试题精解

發(fā)布時間:2023/12/10 编程问答 44 豆豆
生活随笔 收集整理的這篇文章主要介紹了 java scjp 试题_JAVA认证:78道SCJP考试试题精解 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

JAVA認(rèn)證:78道SCJP考試試題精解

QUESTION NO: 70 Which statement about static inner classes is true? A. An anonymous class can be declared as static. B. A static inner class cannot be a static member of the outer class. C. A static inner class does not require an instance of the enclosing class. D. Instance members of a static inner class can be referenced using the class name of the static inner class. Answer: C QUESTION NO: 71 Exhibit: 1. class A { 2. public byte getNumber () { 3. return 1; 4. } 5. } 6. 7. class B extends A { 8. public short getNumber() { 9. return 2; 10. } 11. 12. public static void main (String args[]) { 13. B b = new B (); 14. System.out.printIn(b.getNumber()) 15. } 16. } What is the result? A. Compilation succeeds and 1 is printed. B. Compilation succeeds and 2 is printed. C. An error at line 8 causes compilation to fail. D. An error at line 14 causes compilation to fail. E. Compilation succeeds but an exception is thrown at line 14. Answer: C QUESTION NO: 72 Given: AnInterface is an interface. AnAdapter0 is a non-abstract, non-final class with a zero argument constructor. AnAdapter1 is a non-abstract, non-final class without a zero argument constructor, but with a constructor that takes one int argument. Which two construct an anonymous inner class? (Choose Two) F. AnAdapter1 aa=new AnAdapter1(){} G. AnAdapter0 aa=new AnAdapter0(){} H. AnAdapter0 aa=new AnAdapter0(5){} I. AnAdapter1 aa=new AnAdapter1(5){} J. AnInterface a1=new AnInterface(5){} Answer: B, D QUESTION NO: 73 Which two statements are true? (Choose Two) A. An inner class may be declared as static. B. An anonymous inner class can be declared as public. C. An anonymous inner class can be declared as private. D. An anonymous inner class can extend an abstract class. E. An anonymous inner class can be declared as protected. Answer: A, D QUESTION NO: 74 Exhibit: 1. public class Mycircle { 2. public double radius; 3. public double diameter; 4. 5. public void setRadius(double radius) 6. this.radius = radius; 7. this.diameter= radius * 2; 8. } 9. 10. public double getRadius() { 11. return radius; 12. } 13. } Which statement is true? A. The Mycircle class is fully encapsulated. B. The diameter of a given MyCircle is guaranteed to be twice its radius. C. Lines 6 and 7 should be in a synchronized block to ensure encapsulation. D. The radius of a MyCircle object can be set without affecting its diameter. Answer: B QUESTION NO: 75 You want to limit access to a of a public class to members of the same class. Which access modifier accomplishes this objective? A. Public B. Private C. Protected D. Transient E. No access modifier is required Answer: B QUESTION NO: 76 Exhibit: ClassOne.java 1. package com.abc.pkg1; 2. public class Class

總結(jié)

以上是生活随笔為你收集整理的java scjp 试题_JAVA认证:78道SCJP考试试题精解的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。