On Jun 9, 2:55 am, Ami <[email protected]> wrote:
> 1. Interfaces have methods with no bodies.So,what is the use of
> implementing
>
> built-in interfaces in our programs.
One reason is, one may get a functionality for free. For example: A
class that implements java.io.Serializable could be saved into a
persistent object. A plus point is, the class gets this ability
without implementing any method.
>
> 2. abstract  void drawString(string text, int x, int y) ;
>   Since drawString is abstract so it has no body, but we directly use
> this method
>
> in our program to draw string.Where does compiler get the definition
> of this
>
> method, since we dont provide the definition?
I do not know much about this method, but I am sure some class down
the hierarchy provided this implementation.

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to