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
Zagiel
NA
7
0
How to call parent constructor? Not base one.
Apr 6 2009 1:59 PM
public class A { int a; public A(int a) {this.a = a;} }
public class AB : A { int a; int b; public AB(int a, int b) : base(a) { this.b = b; } }
public class ABC : AB { int a; int b; int c; public ABC(int a, int b, int c) : AB(a, b) { this.c = c; } }
The call of AB(a, b) in ABC() is forbidden. All I can use there seems to be this() or base(). Is there a way to call the constructor of the closest parent, not the one of the oldest ancestor?
Reply
Answers (
3
)
Visual Studio (C# 2008; SQL Server 2008) free edition and 64 don't work togheter
Help me