Which one of the following statements is wrong about inheritance? ( )
A: Inheritance is one of the features of OOP
B: Protected members of a class can be inherited
C: The inheriting class is called a subclass
D: Private members of a class can be inherited and accessed
A: Inheritance is one of the features of OOP
B: Protected members of a class can be inherited
C: The inheriting class is called a subclass
D: Private members of a class can be inherited and accessed
举一反三
- Which statements about inheritance are true?() A: In Java programming language only allows single inheritance. B: In Java programming language allows a class to implement only one interface. C: In Java programming language a class cannot extend a class and implement a interface together. D: In Java programming language single inheritance makes code more reliable.
- Which of the following classes cannot be extended?(). A: class A { } B: class A { private A();} C: final class A { } D: class A { protected A();}
- Which of the following questions about molecular inheritance was not answered by Avery, McCarty and MacLeod's extension of Griffith's transformation experiment? A: Can proteins act as the molecular basis of inheritance? B: Is the molecular basis of inheritance a nucleic acid? C: Can RNA transmit genetic information from one generation to the next? D: Can lipids store genetic information and transmit it from one generation to the next?
- 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
- 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 acce