| | |
triangle, rectangle and TwoDShape
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Apr 2007
Posts: 126
Reputation:
Solved Threads: 6
•
•
•
•
I changed it in my rectangle class but I am still getting 0.0 when I run my driver class.
Do you ever call the calculateAre of Triangle and Rectangle? you should call calculateArea to actually calculate and assing new value to area e.g.
Java Syntax (Toggle Plain Text)
class TwoDShapeDriver { public static void main (String []args) { Triangle t1 = new Triangle(44,55,"scalene"); t1.calculateArea(); System.out.println(t1.toString()); Rectangle r1 = new Rectangle(22,44); r1.calculateArea(); System.out.println(r1.toString()); } }
![]() |
Other Threads in the Java Forum
- Previous Thread: How to get User Name using LDAP when my application URL hitted by user in intranet
- Next Thread: exceptions
Views: 2407 | Replies: 11
| Thread Tools | Search this Thread |
Tag cloud for Java
android api apple applet application apps arguments array arrays automation awt binary bluetooth businessintelligence busy_handler(null) card chat class classes client code collision component constructor database draw eclipse error event eventlistener exception file fractal game givemetehcodez graphics gui helpwithhomework html ide image input integer j2me jar java javafx javamicroeditionuseofmotionsensor javaprojects jmf jni jpanel jtree julia link linux list loop map method methods mobile netbeans newbie nls number object oracle parsing plazmic print problem program programming project recursion scanner screen server set sharepoint size smart sms socket sort sortedmaps sql string swing test textfield threads time transfer tree unlimited utility webservices windows





