Java IS-A exam problem

From MasterExam:

Which statements are true? (Select all that apply)

A. relationships - always rely on inheritance
B. relationships - always rely on instance variables
C. it is a relation that is always required with at least two types of classes
D. relationships - always rely on polymorphism
E. is-a relationship is always tightly connected

Correct answers: A, C, D

I don't see how correct any of A, C or D.

Object Object IS-A Object. String Object IS-A String. There is only one type of class in each of these statements, and inheritance or polymorphism does not apply.

Is my rationale wrong or the answers wrong?

+5
6

, , .

IS-A, String Object. a FileOutputStream IS-A OutputStream IS-A Object.

IS-A - , .

+1

"" . is-a , ( , , has-a, ). , String - . , C. (has-a) . . .

. , D, .

+4

A. , String , ... , . , API, , java.lang.String java.lang.Object. , Java java.lang.Object. . , - .

C. , -, . , "is-a", .

D. . , , "is-a", .

+3

:

  • cat is-a
  • is-a
  • has-a char

, .

+1

, A C D. , , - .. ( , , ). "" , / . , , D. ():) ( ).btw .

+1

, . . , String - Object.

0

All Articles