Describes what the interface is for?

How would you describe the purpose of the student class interface that understands the basic design of OOP?

+3
source share
10 answers

quote from http://java.sun.com/docs/books/tutorial/java/concepts/interface.html

Implementing an interface allows a class to become more formal about its promises behavior. Interfaces form a contract between the class and the outside world , and this is the contract during compiler assembly. If your class claims to implement an interface, all methods defined by this interface in the source code before the class are successfully compiled.

+1
source

"" , "", .

+4

n00b , "" . . ... .

, , "".

, . . () , , .

, , , , . . .

, , Lowe Home Depot, . IE: . . :

  • . , " ", , .
  • , . "" , "" .

, .

+3

, , , , , Java #. "", , , . ,

0

- , promises. , .

0

, - , (, jdbc..). - , , .

0

. , . , .

( ), , .

, , Add , , . ( , ).

0

peters . - . (, )

Addit: , , , IComparable, ISerializable,...

0

, - . , , . , , ?

, . , ( , ).

, , , .

, . , , is-a , , , .

Programming # 4th Edition, - , - , CanBeBoughtWithABigLoan.

0

X Y, :

  • X Y , , , Y.
  • X , Y.

, : , Object, . , , , , , , , , , . , FilledRectangle, FilledEllipse FilledShape FilledEllipse, OutlineEllipse EllipseShape, , FilledEllipse FilledShape EllipseShape, .

, , (), . , IFilledShape , FillColor IEllipseShape, , SetCenter, GetMajorAxis .. IFilledShape, FilledRectangle, FilledEllipse, FilledTriangle , IFilledShape. , FilledEllipse IFilledShape, IEllipseShape IDrawableShape .

0

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


All Articles