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
Bryan Austin
NA
5
0
Object to type
Jan 24 2007 12:47 PM
I have 2 data types in an object array. ExampleBase class ExtendedExample class that extends ExampleBase The the ExampleBase class has a virtual Writeout() method that returns a 'string 1'. The the ExtendedExample class also has virtual Writeout() method that returns 'string 2'. Now when I pull both of them out of the array and cast them both as ExampleBase and they both return 'String 1'. Even though when I use GetType() they return both ExampleBase and ExtendedExample respectively. I want to extend several classes off the ExampleBase class without having to write a lot of code assign a data type when I return the value of the Writeout() method. So is there any way to have it write out a different string even though I cast them as the same base type?
Reply
Answers (
2
)
static class performance
When Maximize Form it shifts to left side of screen