Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: yet another irritating newbie question .....




On Jan 30, 2006, at 2:04 PM, Doug Zwick wrote:

Bob Irving wrote:
		UserDataElement PriceElement = new UserDataElement(elementName);


I was a little surprised after googling the javadoc for the above class which he was trying to subclass that no suggested something like...


super("");

for the missing super constructor invocation, or explicitly since the above 'name' invocation is already a given use...

super(elementName);

Most of the constructor code as already mentioned should, however, probably be split out to a Factory pattern getInstance type method. Or the above completely replaced with this, as the first line, as the super constructor call should of course be first.


Which will only work if UserDataElement has a default constructor:

public UserDataElement() {

The above would most likely work since UserDataElement did appear to have a
public UserDataElement(String name)
constructor when I looked at it off the dom4j doc from Google.


Mike Hall        mikehall at spacestar dot net
http://www.spacestar.net/users/mikehall
http://sourceforge.net/projects/macnative



Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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: 
 >Re: yet another irritating newbie question ..... (From: Doug Zwick <email@hidden>)



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.