• Post Reply Bookmark Topic Watch Topic
  • New Topic

am getting an error for this program can you tell what it means???  RSS feed

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


 
Greenhorn
Posts: 27
Android Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you extend a class (Person) with a customized constructor wich requires a string as parameter.
So the class Employee will automatically invoke the constructor of the superclass, but it requires a parameter (the name).
The compiler adds automatically the call to super:



and this generate the error because the class Person does not have a constructor without parameters. You can modify the code in two ways:



or



hope this helps despite my broken English
 
yaswant kumar kumar
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
wow i got the concept thanks for your very expanded explaination
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!