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
Karan Thakkar
1.2k
204
89.5k
How to pass generic object as parameter in c#?
Sep 12 2019 11:55 PM
I wan to call a method from two diffrent method, but the object which I want to pass is different in both the methods. lets assume an example below.
Public string GetCarDetails(Car carObj)
{
string price=GetCarPrice(carObj);
return price;
}
Public string GetBikePrice(Bike bikeObj)
{
VechileDetails obj = new VechileDetails()
string price=obj.GetBikePrice(bikeObj);
return price;
}
I want to create GetBikePrice method in VechileDetails class which can accept both the object car and bike.
I hope you guys got my problem.
Thanks.
Reply
Answers (
4
)
Crystal Report Not Showing No bugs ?.
Utility doest exist in c#