Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class køretøj
- {
- public int AntalHjul { get; set; }
- public void SigLyd()
- {
- }
- }
- public class Toyota : køretøj, IBouncer,IForanTræk
- {
- public void bounce()
- {
- }
- public void Træk(bool Fremad)
- {
- }
- }
- public class Ford : køretøj,IBouncer
- {
- public void bounce() { }
- }
- public class Subaru : køretøj,IBouncer
- {
- public void bounce() { }
- }
- interface IBouncer
- {
- void bounce();
- }
- interface IForanTræk
- {
- void Træk(bool Fremad);
- }
- class Program
- {
- static void Main(string[] args)
- {
- List<køretøj> vehicles = new List<køretøj>();
- vehicles.Add(new Toyota());
- vehicles.Add(new Subaru());
- vehicles.Add(new Ford());
- List<IBouncer> bouncyKøretøjer = new List<IBouncer>();
- foreach (køretøj item in vehicles)
- {
- }
- System.Console.WriteLine(vehicles[0].AntalHjul);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement