Given a class 

题目

Given a class whose instances, when found in a collection of objects, are sorted by using the compare To method, which two statements are true?()

  • A、The class implements java.lang.Comparable.
  • B、The class implements java.util.Comparator.
  • C、The interface used to implement sorting allows this class to define only one sort sequence.
  • D、The interface used to implement sorting allows this class to define many different sort sequences.
如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

Given:What can directly access and change the value of the variable name?()

A. any class

B. only the Target class

C. any class in the test package

D. any class that extends Target


参考答案:C

第2题:

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

第3题:

_____ time, he’ll make a fist-class tennis player.

A、Having given

B、To give

C、Giving

D、Given


标准答案:D

第4题:

Given that you have a class B IP address network range, which of the subnet masks below will allow for 100 subnets with 500 usable host addresses per subnet?

A.255.255.0.0

B.255.255.224.0

C.255.255.254.0

D.255.255.255.0

E.255.255.255.224


正确答案:C
解析:Explanation:
Using the 2n-2 formula for host addresses, 29-2 = 510 host address, so a 9-bit subnet mask will provide the required number of host addresses. If these 9 bits are used for the hosts in a class B network, then the remaining 7 bits are used for the number of networks.

Again using the 2n-2 formula, we have 2n-2 = 126 networks that are available.

Incorrect Answers:
A. This will provide for only 1 network with 216-2 = 65534 hosts
B. This will provide for 6 networks with 8190 host addresses.
D. This will provide 254 networks and 254 hosts.
E. This will provide 2046 different networks, but each network will have only 30 hosts.

第5题:

Given:Which statement is true about the class of an object that can reference the variable base? ()

A.It can be any class.

B.No class has access to base.

C.The class must belong to the geometry package.

D.The class must be a subclass of the class Hypotenuse.


参考答案:C

第6题:

Given:10. interface Data { public void load(); }11. abstract class Info { public abstract void load(); }Which class correctly uses the Data interface and Info class?()()

A.

B.

C.

D.

E.

F.


参考答案:A

第7题:

Given:Which two, inserted at line 11, will allow the code to compile?()

A.public class MinMax<?> {

B.public class MinMax<? extends Number> {

C.public class MinMax<N extends Object> {

D.public class MinMax<N extends Number> {

E.public class MinMax<? extends Object> {

F.public class MinMax<N extends Integer> {


参考答案:D, F

第8题:

Exhibit:You are creating a composite control for capturing user address information in a Web application. You define a number of properties that the user can set at design time. You need to group these properties in the Properties dialog box. In addition, you need to ensure that when users click on a particular property, they receive a short explanation of that property. The properties are shown in the exhibit. Which two actions should you perform?()

A. Attach the Category attribute class to the controls class definition. Set its value to UserAddress. Mark the class as public.

B. Attach the Browsable attribute class to each property in the group. Set its value to True. Mark the property as private.

C. Attach the Category attribute class to each property in the group. Set its value to UserAddress. Mark the property as public.

D. Attach the Description attribute class to each property in the group. Set each value to a description of the given property.

E. Attach the DefaultProperty attribute class to each property in the group. Set each value to a description of the given property.


参考答案:C, D

第9题:

Given:Which code, inserted at line 15, allows the class Sprite to compile?()

A.Foo { public int bar() { return 1; }

B.new Foo { public int bar() { return 1; }

C.new Foo() { public int bar() { return 1; }

D.new class Foo { public int bar() { return 1; }


参考答案:C

第10题:

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

更多相关问题