我的问题与此类似
public class Ticket {
public int Price{ return null;} }
public class RedTicket extends Ticket {
public int Price { return 40; } }
Ticket t = new RedTicket();
int test = t.Price();
如果我在 C# 中使用virtual/override关键字,我希望这会返回40. 相反,它返回null.
我如何让它返回40?