abstract class and instantiation
From: Michael G (mike-g_at_montana.com)
Date: 10/23/04
- Next message: flaps81: "Re: abstract class and instantiation"
- Previous message: Wired Earp: "Re: Argh! Tomcat 5.5.3"
- Next in thread: flaps81: "Re: abstract class and instantiation"
- Reply: flaps81: "Re: abstract class and instantiation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 23 Oct 2004 09:58:42 -0600
I am not sure why, in the RefinedAbstraction class, that the abstract
baseclass' constructor can be called. I have always thought that abstract
classes cannot be instantiated. It is a little confusing. Would it be better
programming practice to simply assign imp to this. imp in the subclass?
thanks, Mike
abstract class Abstraction{
protected Implementor imp;
public Abstraction(Implementor imp){
this.imp = imp;
}
abstract void operation();
}
class RefinedAbstraction extends Abstraction{
public RefinedAbstraction(Implementor imp){
super(imp); //not sure how this can work.
}
public void operation(){
imp.operationImp();
}
}
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
- Next message: flaps81: "Re: abstract class and instantiation"
- Previous message: Wired Earp: "Re: Argh! Tomcat 5.5.3"
- Next in thread: flaps81: "Re: abstract class and instantiation"
- Reply: flaps81: "Re: abstract class and instantiation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]