aspose file tools*
The moose likes Java Micro Edition and the fly likes Default Constructor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Default Constructor" Watch "Default Constructor" New topic
Author

Default Constructor

pop
Greenhorn

Joined: Jul 20, 2004
Posts: 2
Hi,
Can anyone prove that default constructors are created for you by the compiler (through code)


Prakash Sahu
Jason Fox
Ranch Hand

Joined: Jan 22, 2004
Posts: 114


Subclass will throw an error stating: cannot resolve constructor SuperClass() in class SubClass. This is because the compiler has inserted the default constructor:


If you add an empty constructor to SuperClass, or write your own constructor that passes an int to SuperClass, then it compiles correctly. I hope this helps.
Michael Yuan
author
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
This sounds like a homework question ... And it has almost nothing to do with J2ME.


Seam Framework: http://www.amazon.com/exec/obidos/ASIN/0137129394/mobileenterpr-20/
Ringful: http://www.ringful.com/
Jason Fox
Ranch Hand

Joined: Jan 22, 2004
Posts: 114
You've got a point, maybe I shouldn't have answered. Is there a guideline as to what questions are appropriate, and how to spot homework assignments? No offense intended to the original poster, especially if this wasn't an assignment.
Michael Yuan
author
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
Hi Jason,

I think the best way to answer this type of questions is to give "hints" and small code fragments but not complete answers which people can copy and paste. Thanks a lot.

cheers
Michael
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Default Constructor