单选题It is desirable that a certain method within a certain class can only be accessed by classes that are defined within the same package as the class of the method. How can such restrictions be enforced?()A Mark the method with the keyword public.B Mark t

题目
单选题
It is desirable that a certain method within a certain class can only be accessed by classes that are defined within the same package as the class of the method. How can such restrictions be enforced?()
A

Mark the method with the keyword public.

B

Mark the method with the keyword protected.

C

Mark the method with the keyword private.

D

Mark the method with the keyword package.

E

Do not mark the method with any accessibility modifiers.


相似考题
更多“It is desirable that a certain method within a certain class”相关问题
  • 第1题:

    You develop a serializable class for persisting objects as files.Every time an object is serialized, you have to update the database with the name of the object and location of that file.You elect to employ the OnSerialized attribute to achieve this objective.You now need to apply the OnSerialized attribute to a certain method.What should you do?()

    A.

    B.

    C.

    D.


    参考答案:C

  • 第2题:

    Click the Exhibit button. What is the output if the main() method is run?()

    A.4

    B.5

    C.8

    D.9

    E.Compilation fails.

    F.An exception is thrown at runtime.

    G.It is impossible to determine for certain.


    参考答案:D

  • 第3题:

    When checking students' understanding of a certain language point in class, which of the following utterances is a teacher expected to make?

    A."Is it okay?"
    B."Is it clear to you?"
    C."Are you clear?"
    D."Is it all right to everyone?"

    答案:B
    解析:
    考查课堂提问方式。题干中问“当在课堂上检查学生们对于某个语言点是否理解时,老师应该选择下面哪种表达方式”。B项中有代指语言点的“it’,具有目的性。同时,问题也针对每个同学,问大家是否清楚明白,具有针对性。故选B。

  • 第4题:

    ( ) is a relationship in which a word of a certain class determines the form of others in terms of certain categories.

    A.Concord
    B.Immediate constituent
    C.Syntagmatic relations
    D.Government

    答案:D
    解析:
    考查语义知识。Government(支配关系)is a relationship in which a word of a certain class determines the form of others in terms of certain categories,

  • 第5题:

    1. public class a {  2. public void method1() {  3. try {  4. B b=new b();  5. b.method2();  6. // more code here  7. } catch (TestException te) {  8. throw new RuntimeException(te);  9. }  10. }  11. }  1. public class b {  2. public void method2() throws TestException {  3. // more code here  4. }  5. }  1. public class TestException extends Exception {  2. }  Given:  31. public void method() {  32. A a=new a();  33. a.method1();  34. }  Which is true if a TestException is thrown on line 3 of class b?()

    • A、 Line 33 must be called within a try block.
    • B、 The exception thrown by method1 in class a is not required to be caught.
    • C、 The method declared on line 31 must be declared to throw a RuntimeException.
    • D、 On line 5 of class a, the call to method2 of class b does not need to be placed in a try/catch block.

    正确答案:B

  • 第6题:

    Which methods from the String and StringBuffer classes modify the object on which they are called?()  

    • A、The charAt() method of the String class.
    • B、The toUpperCase() method of the String class.
    • C、The replace() method of the String class.
    • D、The reverse() method of the StringBuffer class.
    • E、The length() method of the StringBuffer class.

    正确答案:D

  • 第7题:

    单选题
    With VIT the start of injection may be () as the engine load is reduced within a certain range.
    A

    advanced

    B

    retarded

    C

    relayed

    D

    cut off


    正确答案: D
    解析: 暂无解析

  • 第8题:

    多选题
    Which lines of code are valid declarations of a native method when occurring within the declaration of the following class?()    public class Qf575 {   // insert declaration of a native method here   }
    A

    native public void setTemperature(int kelvin);

    B

    private native void setTemperature(int kelvin);

    C

    protected int native getTemperature();

    D

    public abstract native void setTemperature(int kelvin);

    E

    native int setTemperature(int kelvin) {}


    正确答案: E,C
    解析: 暂无解析

  • 第9题:

    多选题
    Which three statements are true?()
    A

    A final method in class X can be abstract if and only if X is abstract.

    B

    A protected method in class X can be overridden by any subclass of X.

    C

    A private static method can be called only within other static methods in class X.

    D

    A non-static public final method in class X can be overridden in any subclass of X.

    E

    A public static method in class X can be called by a subclass of X without explicitly referencing the class X.

    F

    A method with the same signature as a private final method in class X can be implemented in a subclass of X.

    G

    A protected method in class X can be overridden by a subclass of X only if the subclass is in the same package as X.


    正确答案: D,G
    解析: 暂无解析

  • 第10题:

    单选题
    Which methods from the String and StringBuffer classes modify the object on which they are called?()
    A

    The charAt() method of the String class.

    B

    The toUpperCase() method of the String class.

    C

    The replace() method of the String class.

    D

    The reverse() method of the StringBuffer class.

    E

    The length() method of the StringBuffer class.


    正确答案: A
    解析: 暂无解析

  • 第11题:

    单选题
    Except as provided for otherwise,an oil tanker might discharge certain amount at certain rate of oil or oily mixtures into sea when().
    A

    the tanker is within 50 nautical miles from the nearest land

    B

    the tanker is no more than 50 nautical miles from the nearest land

    C

    the tanker is more than 50 nautical miles from the nearest land

    D

    the tanker is not more than 50 nautical miles from the nearest land


    正确答案: B
    解析: 暂无解析

  • 第12题:

    单选题
    1. public class a {  2. public void method1() {  3. try {  4. B b=new b();  5. b.method2();  6. // more code here  7. } catch (TestException te) {  8. throw new RuntimeException(te);  9. }  10. }  11. }  1. public class b {  2. public void method2() throws TestException {  3. // more code here  4. }  5. }  1. public class TestException extends Exception {  2. }  Given:  31. public void method() {  32. A a=new a();  33. a.method1();  34. }  Which is true if a TestException is thrown on line 3 of class b?()
    A

     Line 33 must be called within a try block.

    B

     The exception thrown by method1 in class a is not required to be caught.

    C

     The method declared on line 31 must be declared to throw a RuntimeException.

    D

     On line 5 of class a, the call to method2 of class b does not need to be placed in a try/catch block.


    正确答案: B
    解析: 暂无解析

  • 第13题:

    Click the Exhibit button. Given:Which statement is true if a TestException is thrown on line 3 of class B? ()

    A.Line 33 must be called within a try block.

    B.The exception thrown by method1 in class A is not required to be caught.

    C.The method declared on line 31 must be declared to throw a RuntimeException.

    D.On line 5 of class A, the call to method2 of class B does not need to be placed in a try/catch block.


    参考答案:B

  • 第14题:

    An oil tanker,except as provided for otherwise,might discharge certain amount at certain rate of oil or oily mixtures into sea when ______.

    A.she is not within a special area

    B.she is within a special area

    C.she has just departured from a special area

    D.she is about to enter a special area


    正确答案:A

  • 第15题:

    The need for surprise and variety within a forty five-minute lesson is also overwhelming. But variety is not the same as anarchy. Students tend to like a certain amount of___________: they appreciate a safe structure which they rely on.

    A.possibility
    B.impossibility
    C.predictability
    D.teachability

    答案:D
    解析:
    考查名词辨析。possibility“可能性”,impossibility“不可能性”,predictability“可预测性”,teach ability“可教性”。句意为“在45分钟的课堂上对于新奇和多样化的需求势不可挡。但是,多样化不同于没有秩序.学生们趋向于喜欢一些可教性的知识,因为他们喜欢他们所依赖的已知的语言结构”。故选D。

  • 第16题:

    Which two statements are true about the hashCode method?()

    • A、 The hashCode method for a given class can be used to test for object equality and object inequality for that class.
    • B、 The hashCode method is used by the java.util.SortedSet collection class to order theelements within that set.
    • C、 The hashCode method for a given class can be used to test for object inequality, but NOT object equality, for that class.
    • D、 The only important characteristic of the values returned by a hashCode method is that the distribution of values must follow a Gaussian distribution.
    • E、 The hashCode method is used by the java.util.HashSet collection class to group the elements within that set into hash buckets for swift retrieval.

    正确答案:C,E

  • 第17题:

    It is desirable that a certain method within a certain class can only be accessed by classes that are defined within the same package as the class of the method. How can such restrictions be enforced?()  

    • A、Mark the method with the keyword public.
    • B、Mark the method with the keyword protected.
    • C、Mark the method with the keyword private.
    • D、Mark the method with the keyword package.
    • E、Do not mark the method with any accessibility modifiers.

    正确答案:E

  • 第18题:

    You are implementing a Windows Communication Foundation (WCF) client application that consumes the ICatalog and lCatalog2 service interfaces.You need to ensure that the client discovers services implementing these interfaces. The services may already be online or may come online within a 30 second time limit. How should you use WCF Discovery to accomplish this?()

    • A、Create one FindCriteria object for each interface and set the Duration of each FindCriteria to 30 seconds. Call the FindAsync method of the DiscoveryClient class twice, one time for each of the FindCriteria objects, to search for the services.
    • B、Create one FindCriteria object for each interface and set the Duration of each FindCnteria to two seconds. Create a loop that calls the Find method of the DiscoveryClient class to search for the services. Within each loop iteration, call the Find method of the DiscoveryClient class once for each of the FindCriteria objects. Run the loop until a service is found or 30 seconds pass.
    • C、Create a single FindCriteria object and add both interfaces to its ContractTypeNames collection. Set the criteria's Duration to two seconds. Create a loop that calls the Find method of the DiscoveryClient class to search for the services. Within each loop iteration, call the Find method of the DiscoveryClient class to search for the services Run the loop until a service is found or 30 seconds pass.
    • D、Create a single FindCritera object and add both interfaces to the ContractTypeNames collection. Set the Duration to 30 seconds and use the FindAsync method of the DiscoveryClient class to search for the services.

    正确答案:B

  • 第19题:

    单选题
    If the goods are not delivered,or delivered in a damaged condition,a claim may be ()within a period of certain years unless there is a clause to the contrary in the charter-party or bill of lading.
    A

    taken

    B

    gone

    C

    gotten

    D

    made


    正确答案: A
    解析: 暂无解析

  • 第20题:

    单选题
    It is desirable that a certain method within a certain class can only be accessed by classes that are defined within the same package as the class of the method. How can such restrictions be enforced?()
    A

    Mark the method with the keyword public.

    B

    Mark the method with the keyword protected.

    C

    Mark the method with the keyword private.

    D

    Mark the method with the keyword package.

    E

    Do not mark the method with any accessibility modifiers.


    正确答案: D
    解析: 暂无解析

  • 第21题:

    单选题
    The auctioneer may decide to sell the “lots” out of the order because _____.
    A

    he sometimes wants to confuse the buyers

    B

    he knows from experience that certain people will want to buy certain items

    C

    he wants to keep certain people waiting

    D

    he wants to reduce the number of buyers


    正确答案: C
    解析:
    由文章第三段中:he may wait until he registers the fact that certain dealers are in the room and then produce the lots they are likely to be interested in,拍卖商不按常规拍卖,是为了确定准买家的情况,推测他们可能喜欢的东西,再决定拍卖。B选项符合题意。

  • 第22题:

    单选题
    An oil tanker,except as provided for otherwise,might discharge certain amount at certain rate of oil or oily mixtures into sea when().
    A

    she is not within a special area

    B

    she is within a special area

    C

    she has just departured from a special area

    D

    she is about to enter a special area


    正确答案: D
    解析: 暂无解析

  • 第23题:

    单选题
    Sometimes the charter-party()that the vessel must only use safe ports within a certain area.
    A

    improves

    B

    installs

    C

    contains

    D

    requests


    正确答案: C
    解析: 暂无解析

  • 第24题:

    多选题
    Which two statements are true about the hashCode method?()
    A

    The hashCode method for a given class can be used to test for object equality and object inequality for that class.

    B

    The hashCode method is used by the java.util.SortedSet collection class to order theelements within that set.

    C

    The hashCode method for a given class can be used to test for object inequality, but NOT object equality, for that class.

    D

    The only important characteristic of the values returned by a hashCode method is that the distribution of values must follow a Gaussian distribution.

    E

    The hashCode method is used by the java.util.HashSet collection class to group the elements within that set into hash buckets for swift retrieval.


    正确答案: E,B
    解析: 暂无解析