SCJP程序员认证考试

单选题You want to limit access to a method of a public class to members of the same class. Which access modifier accomplishes this objective?()APublicBPrivateCProtectedDTransientENo access modifier is required

题目
单选题
You want to limit access to a method 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

参考答案和解析
正确答案: B
解析: 暂无解析
如果没有搜索结果,请直接 联系老师 获取答案。
相似问题和答案

第1题:

You are securing a network for TestKing and want to apply an ACL (access control list) to an interface of a router. Which one of the following commands would you use?()

  • A、permit access-list 101 out
  • B、ip access-group 101 out
  • C、apply access-list 101 out
  • D、access-class 101 out
  • E、ip access-list e0 out

正确答案:B

第2题:

You want a class to have access to members of another class in the same package. Which is the most restrictive access that accomplishes this objective?()  

  • A、 public
  • B、 private
  • C、 protected
  • D、 transient
  • E、 default access

正确答案:E

第3题:

阅读下列代码段,选出该代码段的正确文件名( )。 class A { void method1() { System.out.println("method1 in class A"); } } public class B { void method2() { System.out.println("method2 in class B"); } public static void main(String args[]) { System.out.println("main in class B"); } }

A.A.java

B.A.class

C.B.class

D.B.java


正确答案:D
解析:Java源程序文件是以Java为后缀的,Java字节码文件以.class为后缀,而且 Java源文件中只能有一个public类,该类的名字为源文件名,程序段中类B是以public修饰的,因此源程序文件名为Biava。

第4题:

You want to provide a tool that allows users quick access to form modules, by listing them in an Explorer-style interface. Which reusable component do you use?()

  • A、ActiveX controls 
  • B、Calendar Class 
  • C、Standard Object Library 
  • D、Picklist Class 
  • E、Wizard Class 
  • F、Navigator Class

正确答案:F

第5题:

You want to limit access to a method of a public class to members of the same class. Which access accomplishes this objective?()  

  • A、 public
  • B、 private
  • C、 protected
  • D、 transient
  • E、 default access

正确答案:B

第6题:

public class CreditCard {  private String cardlD;  private Integer limit;  public String ownerName;  public void setCardlnformation(String cardlD,  String ownerName, 28. Integer limit) {  this.cardlD = cardlD;  this.ownerName = ownerName;  this.limit = limit;  }  } Which is true?() 

  • A、 The class is fully encapsulated.
  • B、 The code demonstrates polymorphism.
  • C、 The ownerName variable breaks encapsulation.
  • D、 The cardlD and limit variables break polymorphism.
  • E、 The setCardlnformation method breaks encapsulation.

正确答案:C

第7题:

Given an ActionEvent, which method allows you to identify the affected Component?()  

  • A、 Public class getClass()
  • B、 Public Object getSource()
  • C、 Public Component getSource()
  • D、 Public Component getTarget()
  • E、 Public Component getComponent()
  • F、 Public Component getTargetComponent()

正确答案:B

第8题:

You are developing a Windows Communication Foundation (WCF) REST service to provide access to a library book catalog. The following code segment defines the service contract. (Line numbers are included for reference only.)01 [ServiceContract()]02 [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]03 public Class LibraryService04 {05 public Book GetBookByTitle(string title)06 {07 ...08 }0910 [WebGet(UriTemplate = "Book/{id}")]11 public Book GetBookById(string id)12 {13 ...14 }15 }Library patrons want the ability to search the catalog by title.You need to ensure that the GetBookByTitle method is exposed as a service method.Which code segment should you insert at line 04?()

A. [WebGet(UriTemplate = "Book/{title}")]

B. [WebGet(UriTemplate = "BookByTitle/{title}")]

C. [WebGet(UriTemplate = "Book/{titleToSearch}")]

D. [WebGet(UriTemplate = "{titleToSearch}")]


参考答案:B

第9题:

You want to limit access to a method 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

正确答案:B

第10题:

You are creating a job class. You want access to the detailed information for all the runs of each job in the class and every operation performed on every job in the class. Which setting will you use for the LOGGING_LEVEL parameter?()

  • A、 LOGGING_OFF
  • B、 LOGGING_RUNS
  • C、 LOGGING_FULL
  • D、 LOGGING_NULL

正确答案:C

更多相关问题