An encapsulated, public class promotes re-use.
Classes that share the same interface are always tightly encapsulated.
An encapsulated class allows subclasses to overload methods, but does NOT allow overriding methods.
An encapsulated class allows a programmer to change an implementation without affecting outside code.
第1题:
public class SomeException { } Class a: public class a { public void doSomething() { } } Class b: public class b extends a { public void doSomething() throws SomeException { } } Which is true about the two classes?()
第2题:
In which two cases does the compiler supply a default constructor for class A?()
第3题:
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.
第4题:
class One { public One foo() { return this; } } class Two extends One { public One foo() { return this; } } class Three extends Two { // insert method here } Which two methods, inserted individually, correctly complete the Three class?()
第5题:
Which two allow the class Thing to be instantiated using new Thing()?
第6题:
Which two are true?()
第7题:
Which three demonstrate an “is a” relationship?()
第8题:
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> {
第9题:
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?()
第10题:
Which the two demonstrate an “is a” relationship?()