Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text.RegularExpressions;
- namespace Rextester
- {
- public class Program
- {
- public static void Main(string[] args)
- {
- Carro carro = new Carro();
- //Como Ler esse campo?
- Console.WriteLine(carro.Tipo.Placa);
- }
- public class Carro
- {
- public MarcaDeCarro Tipo {get; set;}
- public Carro(){Tipo = new Sedan();}
- }
- public class Sedan : MarcaDeCarro
- {
- public int Placa{get;set;}
- }
- public abstract class MarcaDeCarro
- {
- }
- }
- }
Add Comment
Please, Sign In to add comment