Hi Ami, Question 1. You are correct. Interfaces are never required, but in VERY large projects they can really help decrease the errors.
I posted a good explanation as to the best use of interfaces and someone took it down. It was a little off topic and rather long- winded, but I thought it answered the question thoroughly. Maybe the person that took it down will shorten/correct my answer and post it here. Question 2. It is part of the java.awt.Graphics class and the java.awt.Graphics2D class as well as other classes. Please see: http://www.aicas.com/jamaica/doc/jamaica_api/java/awt/Graphics2D.html On Jun 8, 1:55 pm, Ami <[email protected]> wrote: > 1. Interfaces have methods with no bodies.So,what is the use of > implementing > > built-in interfaces in our programs. > > 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? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
