mikester2
October 7th, 2004, 09:51 PM
If the java.awt.Graphics class is abstract then how can methods such as this.getGraphics() return a Graphics object ?
;TT
October 7th, 2004, 11:10 PM
Polymorphism allows it to return a Graphics object because its actually calling a subclass with a method that actually returns a value.. I don't know the specifics of it but the Graphics class is a super class and then it has a blank outline out what methods each subclass has to have...
See this link for more explanation: http://java.sun.com/docs/books/tutorial/java/javaOO/abstract.html
Juridian
October 8th, 2004, 12:40 AM
most likely because whatever class 'this' is an instance of inherits from java.awt.Graphics.