Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!newsfeed.CARNet.hr!news.metronet.hr!not-for-mail From: Screamin Lord Byron Newsgroups: comp.lang.java.programmer Subject: Re: Double always returning 0.0 Date: Tue, 19 Apr 2011 19:05:21 +0200 Organization: Metronet Lines: 19 Message-ID: References: <201104182005433244-jasonsavlov@mecom> <2011041911160346799-jasonsavlov@mecom> NNTP-Posting-Host: 78.134.131.26 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 7bit X-Trace: news.metronet.hr 1303232719 22803 78.134.131.26 (19 Apr 2011 17:05:19 GMT) X-Complaints-To: abuse@metronet.hr NNTP-Posting-Date: Tue, 19 Apr 2011 17:05:19 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 In-Reply-To: <2011041911160346799-jasonsavlov@mecom> X-Enigmail-Version: 1.1.2 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:3142 On 19.04.2011 17:16, Jason S wrote: > On 2011-04-19 05:02:09 -0400, Screamin Lord Byron said: > >> On 19.04.2011 02:05, Jason S wrote: >>> I'm trying to figure out why I can't seem to get my program to return >>> the correct value here. It always returns 0.0 even though I (think) that >>> everything is declared/cast correctly... >>> >>> Code located at http://web.cs.sunyit.edu/~savlovj/CS249/pg472_8 >> >> Remember that instance variables aren't inherited. That is, you are >> using values from Dog and Cat, rather than Pet, which are initialized to >> their defaults. > > Yup, that was the problem. Got it working! (Sort of...) The weight for > the cat keeps turning up as 0.000. I think you didn't understood what I said. You need only one name, one age and one weight varable per object. Why do you have two?