Java Interface where to Use,Core Java Tutorials

You use an interface to define a protocol of behavior that can be implemented by any class anywhere in the class hierarchy. Interfaces are useful for the following:
Capturing similarities between unrelated classes without artificially forcing a class relationship
Declaring methods that one or more classes are expected to implement
Revealing an object's programming interface without revealing its class. (Objects such as these are called anonymous objects and can be useful when shipping a package of classes to other developers.)

No comments:

Post a Comment

Please Provide your feedback here