Interfaces and Abstract Classes

What does not correspond to interfaces and abstract classes? (at least check two answers)

and. Abstract class support for inheritance relationships, but not implementations.

b. The interface maintains an implementation relationship, but not an inheritance relationship.

with. Both abstract classes and interfaces maintain inheritance relationships.

e. All of the above statements are true.

I am a bit confused about the answer if anyone can help me. My guess: a, b, d

+3
source share
2 answers

, , , . , (d) . , .

- . , "" . : (, ) ( , )? "" "" . , . :

  • : "parent" , "child",
  • : "parent" , , "child" , .

, , "" "". java, , "" "", "" "". - . , Java "extends".

OK. , , .

               |  Inheritance  |   Realisation  |
               |parent | child | parent | child |
---------------|-------|-------|--------|-------| 
Abstract Class |   T   |   T   |    F   |   T   |
Interface      |   T   |   T   |    T   |   F   |
-------------------------------------------------

,

  • .
  • .

, , "" " ", "".

. , .

, , "". Inheritance, , . . , ? , "" " " - - " " - .

(b) .

(c), , . Inheritance, (c) . , "" " ", "", (c) .

: .

.

+2

oh memories... Java-?

.
.
.
. wtf ? ? , ... false

answser...

+1

Source: https://habr.com/ru/post/1788406/


All Articles