| | |
triangle, rectangle and TwoDShape
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
| Thread Tools | Search this Thread |
android api applet application apps array arrays automation awt bidirectional binary birt bluetooth businessintelligence busy_handler(null) card chat class classes client code collision columns component constructor database designadrawingapplicationusingjavajslider draw eclipse editor error errors eventlistener exception expand fractal game givemetehcodez graphics gui guidancer html ide image inetaddress input integer intellij j2me java javafx javamicroeditionuseofmotionsensor javaprojects jme jni jpanel jtree julia linux list loop machine map method methods mobile mobiledevelopmentcreatejar myaggfun netbeans newbie oracle parsing plazmic print problem program programming project recursion scanner server set sharepoint size smart sms smsspam sort sortedmaps sql string subclass support swing threads tree unlimited utility webservices windows





