This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes Problem in understanding -how interface helpful Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Problem in understanding -how interface helpful" Watch "Problem in understanding -how interface helpful" New topic

Problem in understanding -how interface helpful

abdul ambalam

Joined: Dec 01, 2003
Posts: 1
interface does not have method implementation. only class which implements interface must implememt all the methods defined in interface.
My question is why should we implement interface as we can write our own code. In java, Serializable and Cloneable dont have anything inside. How it is useful in serializing and cloning objects. does compiler have anything to understand these interfaces. I have many question regarding interfaces.
Can anyone answer to all the possible questions reg-interfaces. Thankyou.
Jeanne Boyarsky
internet detective

Joined: May 26, 2003
Posts: 30138

The interface is a way of declaring your intent. While Serializable doesn't have any required methods, you are telling the compiler that it is ok to serialize your object.

[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
I agree. Here's the link:
subject: Problem in understanding -how interface helpful
Similar Threads
any manual or book about designing some plug-able library like JDBC?
Interface question from Khalid and Rasmussen
Interview questions for Java developer, Struts, EJBs
Multiple Inheritance ?
interface implements