Meaningless Drivel is fun!
The moose likes Beginning Java and the fly likes abstract class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "abstract class" Watch "abstract class" New topic

abstract class

vidu sri

Joined: Jun 15, 2009
Posts: 8
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

Joined: Oct 13, 2005
Posts: 45348
And what error are you getting?
Ulises Pulido
Ranch Hand

Joined: Jul 24, 2008
Posts: 81
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();

SCJP 5.0, SCWCD 5.0, SCBCD 5.0, SCJD, SCEA in progress
vidu sri

Joined: Jun 15, 2009
Posts: 8
after running,i got as at computer.selection(
After changing selection(); as super.selection(); , i got the output.
I agree. Here's the link:
subject: abstract class
It's not a secret anymore!