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
Maha
NA
0
326.3k
GetType() method
Mar 8 2012 4:30 PM
In the following program instead of giving the type of the object, output gives the name of the constructor. Please explain the
reason for this.
using System;
class A
{
}
class B : A
{
}
class C : B
{
}
class Program
{
static void Main()
{
A a1 = new
A
();
A a2 = new
B
();
A a3 = new
C
();
Console.WriteLine(a1.GetType());
Console.WriteLine(a2.GetType());
Console.WriteLine(a3.GetType());
Console.ReadKey();
}
}
/*
A
B
C
*/
Reply
Answers (
2
)
carry textbox value
Combobox