File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Abstract Class and Inheritance

 
Hiep Nguyen
Ranch Hand
Posts: 46
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13974
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Michael Morris
Ranch Hand
Posts: 3451
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Hiep Nguyen
Ranch Hand
Posts: 46
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic