Why don't all Java classes have interfaces?

I have this question for homework and I'm not sure how to answer it. could you help me?

+3
source share
6 answers

For any question “why not ...”, it’s good to think about “what happens if ...”. In this case: what happens if an interface is needed for each Java class? How will this change existing APIs? How will this make a difference for people creating new classes? Any problems that arise when answering these other questions may be the answer to your original question.

+10
source

, Java ( , , ).

+2

, . - , .

+1

, , . "?", : , , , , , , ... ..:) , .

, , , , , . . , :)

+1

. String Date?

0

- /, . , ? " ". , Thread Runnable. . "" /?

0

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


All Articles