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
Prakash Tripathi
30
40k
6.3m
C# OOPs question
Mar 11 2015 10:18 PM
Hi guys,
I have a class like below. My queries are highlited below in Main method.
class Base
{
internal void DoWork()
{
Console.WriteLine("From Base");
}
}
class Derived: Base
{
internal void DoWork()
{
Console.WriteLine ("From Derived");
}
internal void DoMoreWork()
{
Console.WriteLine("New Derived");
}
}
class Program
{
static void Main(string[] args)
{
Derived d1 = new Base(); //
Doesn't work why?
Base b1 = new Derived();
//Works why?
b1.DoWork();
//Execute Base method why?
}
Appreciate your responses for my highlited questions above.
Regards..
Reply
Answers (
2
)
Print several images using windows print image dialog in C#?
How to wait for async method before executing nxt method?