This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

abstract class

 
vidu sri
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a public abstract class in a separate package.
A class in default package has to extend it.And object is
created for the sub class.The main is found in default package.
but i get error.



 
Campbell Ritchie
Sheriff
Posts: 48910
58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And what error are you getting?
 
Ulises Pulido
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe an stack overflow error.

# public void selection()
# {
# selection();
# System.out.println("join on dec 21");
# }

if you want to use the selection method of the parent class use super.selection();
 
vidu sri
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
after running,i got as at computer.selection(general.java:6)
After changing selection(); as super.selection(); , i got the output.
THANKS A LOT
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic