| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On Jan 29, 2006, at 5:58 AM, Bob Irving wrote:
This is a weird looking constructor. 1) It is attempting to return a value, constructors don't return anything then just initialize the instance. 2) It isn't calling a construct for your super class before anything else in it (likely could call super(elementName)). 3) It is constructing a instance of UserDataElement when in fact PriceElement extends UserDataElement, so I think you are meaning to construct yourself instead. 4) You are using an instance variable that is the same name are your class (not even sure that will compile). 5) Your constructor takes 3 parameters that appear to align with 3 instance vars you have yet it doesn't assign anything to them (constructor isn't likely doing what you want). I believe (2) is the source of the error you are getting but I bet you will get others once you fix that one. I think you want (not looking at the java docs for UserDataElement... public PriceElement (String currency, String price, String elementName) { super(elementName); Element money = addElement("Money"); money.addAttribute( "currency", currency); money.addText(price); } -Shawn |
_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/java-dev/email@hidden This email sent to email@hidden
| References: | |
| >yet another irritating newbie question ..... (From: Bob Irving <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.