单项选择题

A team of programmers is involved in reviewing a proposed design for a new utility class. After some discussion, they realize that the current design allows other classes to access methods in the utility class that should be accessible only to methods within the utility class itself.
What design issue has the team discovered?()

A.Tight coupling
B.Low cohesion
C.High cohesion
D.Loose coupling
E.Weak encapsulation


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题

Given:
11.double input = 314159.26;
12.NumberFormat nf = NumberFormat.getInstance(Locale.ITALIAN);
13.String b;
14.//insert code here
Which code, inserted at line 14, sets the value of b to 314.159,26?()

A.b = nf.parse( input );
B.b = nf.format( input );
C.b = nf.equals( input );
D.b = nf.parseObject( input );

5.多项选择题Which two scenarios are NOT safe to replace a StringBuffer object with a StringBuilder object?()

A.When using versions of Java technology earlier than 5.0.
B.When sharing a StringBuffer among multiple threads.
C.When using the java.io class StringBufferInputStream.
D.When you plan to reuse the StringBuffer to build more than one string.

7.单项选择题

Given:

What is the result?()

A.int Long
B.Short Long
C.Compilation fails.
D.An exception is thrown at runtime.

8.单项选择题

Given:

Which statement is true?()

A.Compilation fails.
B.An exception is thrown at runtime.
C.Synchronizing the run() method would make the class thread-safe.
D.The data in variable "x" are protected from concurrent access problems.
E.Declaring the doThings() method as static would make the class thread-safe.

10.多项选择题

Given:

Which three changes should be made to adapt this class to be used safely by multiple threads?()

A.declare reset() using the synchronized keyword
B.declare getName() using the synchronized keyword
C.declare getCount() using the synchronized keyword
D.declare the constructor using the synchronized keyword
E.declare increment() using the synchronized keyword

最新试题

Given a method that must ensure that its parameter is not null:What, inserted at line 12, is the appropriate way to handle a null value?()

题型:单项选择题

Given a correctly compiled class whose source code is:Assume that the class file is located in /foo/com/sun/sjcp/, the current directory is /foo/, and that theclasspath contains "." (current directory).Which command line correctly runs Commander?()

题型:单项选择题

Given:What is the result?()

题型:单项选择题

Given:What is the result?()

题型:单项选择题

Given:What is the result?()

题型:单项选择题

Given:What is the result?()

题型:单项选择题

A team of programmers is involved in reviewing a proposed design for a new utility class. After some discussion, they realize that the current design allows other classes to access methods in the utility class that should be accessible only to methods within the utility class itself.What design issue has the team discovered?()

题型:单项选择题

Given:What is the appropriate definition of the hashCode method in class Person?()

题型:单项选择题

Given:What is the result?()

题型:单项选择题

A programmer has an algorithm that requires a java.util.List that provides an efficient implementation of add(0, object), but does NOT need to support quick random access.What supports these requirements?()

题型:单项选择题