aspose file tools*
The moose likes Beginning Java and the fly likes Abstract Class and Inheritance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Abstract Class and Inheritance" Watch "Abstract Class and Inheritance" New topic
Author

Abstract Class and Inheritance

Hiep Nguyen
Ranch Hand

Joined: Oct 26, 2001
Posts: 46
i write an abstract class that extends JFrame, and a subclass is extended the abstract class. but when i compile, it make an error at contructor. what should i do?
this is my code
*******************

thank you
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
The normal reason for getting this error is, since the abstract class doesn't have a default constructor all the constructors of the extending class must have "super(title);" as the first staement in their constructors. The code snip you showed us should be fine.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi Hiep,
You have a syntax error on your first ListForm class declaration: it should be abstract class instead of class abstract but that should not cause the error you say the compiler is indicating. By changing that, your code should compile. There must be some problem in the implementation of the abstract methods.
Hope this helps,
Michael Morris


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Hiep Nguyen
Ranch Hand

Joined: Oct 26, 2001
Posts: 46
thanh you for your replies !
in my working code, i passed wrong parameters, the misstake takes me long time to debug so i 'm really supid man
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Abstract Class and Inheritance