Talk:Interface (Java): Difference between revisions

Content deleted Content added
Line 20:
but can any interfaces(e.g Connection) have defined methods(e.g createStatement)?
 
An interface will not have any body(definition) in it's method. It's methodmethods are made to be overrode. Think of an interface as a contract. Every method in that contact must be used in your class. You must implement all methods from an interface in the class that will use it. In that class you will override the interfaces methods and give them their body .
 
here is a sample interface