2016-11-30

posted Nov 30, 2016, 6:25 AM by Samuel Konstantinovich   [ updated Nov 30, 2016, 6:25 AM ]
A note on interfaces:
"Implementing an interface allows a class to become more formal about the behavior it promises to provide. Interfaces form a contract between the class and the outside world, and this contract is enforced at build time by the compiler. If your class claims to implement an interface, all methods defined by that interface must appear in its source code before the class will successfully compile."

"When you define a new interface, you are defining a new reference data type. You can use interface names anywhere you can use any other data type name. If you define a reference variable whose type is an interface, any object you assign to it must be an instance of a class that implements the interface."


Comments