Steve Coddington
Thanks and Regards,
SCJP 1.5 (90%), SCWCD 1.5 (85%), The Jovial Java, java.util.concurrent tutorial
If you extend your Triangle class to create a RightTriangle class, the method will behave polymorphically and print something like this:com.jain.sunny.Triangle@1234abcd: sides: 3.00000 3.00000 3.00000
So there might be no need to override the method.com.jain.sunny.RightTriangle@123abcde: sides: 3.00000 4.00000 5.00000
That is what you will get even if you declareRemember polymorphism will give the method which is attached to the instance via its class object, not the version in the superclass you declare.com.jain.sunny.RightTriangle@12abcdef: sides: 3.00000 4.00000 5.00000: In RightTriangle class
Thanks and Regards,
SCJP 1.5 (90%), SCWCD 1.5 (85%), The Jovial Java, java.util.concurrent tutorial
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Thanks and Regards,
SCJP 1.5 (90%), SCWCD 1.5 (85%), The Jovial Java, java.util.concurrent tutorial