TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Marco
NA
59
0
inerith-virtual - override
Sep 28 2007 10:09 AM
hi, I 've got a simple problem with subclass and method (I'll leave out some keywords to go direct to problem...). I hope you'll understand the problem....
abstract baseClass {
List <baseClass> list = new List<BaseClass>();
List<Two> list_two=new List<Two>();
virtual add(BaseClass class) {
list.Add(class);
if (class.Type is "Two" also do.......)
list_two.Add(class); //here error, because class hasn't same type of list_two...
}
}
class One : baseClass {
override void add(BaseClass class) {
// do something
base.add(class);
}
}
class Two : baseClass{
//constructor and the rest
}
main {
Two two;
One one;
one.add(new two() );
}
Must I have refactor the classes or how can I do this things?
thanks...
Reply
Answers (
7
)
Help regarding cell click event in datagridview
NP46 constructor & non-constructor