using System;
namespace POLYMORPHISM1
{
public class Program
{
static void Main(string[] args)
{
Vehicle vehicle = new Vehicle();
Vehicle vehicle1 = new Car();
Vehicle vehicle2 = new Truk();
vehicle.start();
vehicle.horn();
vehicle.stop();
vehicle1.start();
vehicle1.horn();
vehicle1.stop();
vehicle2.start();
vehicle2.horn();
vehicle2.stop();
Console.ReadLine();
}
}
public class Vehicle
{
public virtual void start() { Console.WriteLine("Vehicle Started"); }
public virtual void horn() { Console.WriteLine("Vehicle Horned"); }
public virtual void stop() { Console.WriteLine("Vehicle Stopped"); }
}
public class Car : Vehicle
{
public override void start() { Console.WriteLine("Car Started"); }
public override void horn() { Console.WriteLine("Car Horned"); }
public override void stop() { Console.WriteLine("Car Stopped"); }
}
public class Truk : Vehicle
{
public override void start() { Console.WriteLine("Truck Started"); }
public override void horn() { Console.WriteLine("Truck Horned"); }
public override void stop() { Console.WriteLine("Truck Stopped"); }
}
}
15 Comments
Good blog,Great experience for me by reading this article.
ReplyDeletecore java training in chennai
C++ programming course
c++ course fees
C and C++ institute
c c++ course
javascript course in chennai
Appium Training in Chennai
JMeter Training in Chennai
IEEE Final Year Project centers make amazing deep learning final year projects ideas for final year students Final Year Projects for CSE to training and develop their deep learning experience and talents.
DeleteIEEE Final Year projects Project Centers in India are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes, while specialists like the enjoyment in interfering with innovation.
corporate training in chennai corporate training in chennai
corporate training companies in india corporate training companies in india
corporate training companies in chennai corporate training companies in chennai
I have read your blog its very attractive and impressive. I like it your blog. Digital Marketing Company in Chennai
Informative blog! it was very useful for me.Thanks for sharing. Do share more ideas regularly.
ReplyDeleteSpoken English Classes in Chennai
Best Spoken English Classes in Chennai
IELTS Coaching in Chennai
IELTS Coaching Centre in Chennai
English Speaking Classes in Mumbai
English Speaking Course in Mumbai
IELTS Classes in Mumbai
IELTS Coaching in Mumbai
I would definitely thank the admin of this blog for sharing this information with us. Waiting for more updates from this blog admin.
ReplyDeleteMachine Learning course in Chennai
Machine Learning Training in Chennai
Azure Training in Chennai
Cloud Computing Training in Chennai
RPA Training in Chennai
UiPath Training in Chennai
Thanks for sharing a valuable information to us. keep on sharing like this.
ReplyDeleteBest Aviation Academy in Chennai
Best Air hostess Training in Chennai
Pilot Training in Chennai
Airport Ground staff Training in Chennai
Airport Flight Dispatcher Trainee in Chennai
RTR - Aero Training in Chennai
Cabin Crew Training in Chennai
Aviation Academy in Chennai
Aviation training institute in Chennai
Aviation Course Training in Chennai
Ground staff Training institute in Chennai
Airhostess Training institute in Chennai
Cabin Crew Course
PRIVATE PILOT LICENCE (PPL) Training in Chennai
COMMERCIAL PILOT LICENCE (CPL) Training in Chennai
I really like your post. I found it very helpful. Please keep posting such kind of valuable post.
ReplyDeleteC++ Course in Delhi
I read your post and got it quite informative. I couldn't find any knowledge on this matter prior to. I would like to thanks for sharing this article here. Best C++ With Data Structures Course In Delhi
ReplyDeleteIt’s actually a great and also handy section of details. I am just fulfilled that you simply contributed this helpful info along with us.. Be sure to keep us knowledgeable similar to this. Thank you for expressing.
ReplyDeletecash for cars ipswich
cash for cars sunshine coast
Great remarkable issues here. I’m very glad to look your article. Thanks a lot and I am having a look forward to touch you. Will you please drop me a mail?
ReplyDeletecash for cars north brisbane
old car removal brisbane
Cool one! Interesting informations over this web. It is pretty worth enough for me. Personally, if all site owners and bloggers made good content as you did, the net will be much more useful than ever before.| I could not resist commenting. I ‘ve spent some hours looking for such tips. I’ll also share it with a couple of friends interested in it.
ReplyDeleteskip bin hire darra
skip bin hire yeerongpilly
Thank you very much for the information provided! I was looking for this data for a long time, but I was not able to find the trusted source.. I’ve learn several good stuff here. Definitely price bookmarking for revisiting. I wonder how so much attempt you place sex make this kind of fantastic informative web site.
ReplyDeletecar removal brisbane
car wreckers brisbane
Fantastic goods from you, man. I've understand your stuff previous to and you are just extremely fantastic. I really like what you have acquired here, really like what you are stating and the way in which you say it. You make it entertaining and you still take care of to keep it sensitive. I can't wait to read far more from you. This is really a tremendous site.
ReplyDeletecash for cars brisbane
scrap cars brisbane
You actually make it seem so easy with your presentation but I find this topic to be really something which I think I would never understand. It seems too complicated and extremely broad for me. I’m looking forward to your next post, I will try to get the hang of it!
ReplyDeletewe buy scrap cars
car buyer Melbourne
cash for cars toowoomba
Took me time to read all the comments, but I really enjoyed the article. It proved to be Very helpful to me and I am sure to all the commenters here! It’s always nice when you can not only be informed, but also entertained! carros PCs 2021
ReplyDeleteThanks For sharing this Superb article.I use this Article to show my assignment in college.it is useful For me Great Work. rastreamento veicular
ReplyDelete