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
amit_gupta14
NA
119
0
Is it compulsory to present a constructor in base class with 0 argument
Dec 9 2004 1:15 AM
public class myBaseClass { public myBaseClass() { code } public myBaseClass(int age) { code } } public class myDerivedClass : myBaseClass { public myDerivedClass() { code } public myDerivedClass(int age) { code } } myDerivedClass obj = new myDerivedClass(); This is original code. If I make comment to base class constructor without argument i.e. /*public myBaseClass() { code }*/ and now run the same code , error comes "No overload for method 'myBaseClass' takes '0' arguments" Why? Is it compulsory that if any constructor is present with one parameter in base class, then constructor with 0 arguments should also be present.
Reply
Answers (
4
)
writing Chr(9) to text file
message box