Sunday, 15 May 2011

c# - XNA inheritance issues -



c# - XNA inheritance issues -

basically here simplified version of problem

public class a() { public int getnum() { homecoming 5; } } public class b() : a() { public int getnum() { homecoming 12; } } test = new b(); test.getnum();

i test.getnum() homecoming twelve instead entire getnum function in b underlined in green. doing wrong?

look inheritance , virtual

public class { public virtual int getnum() { homecoming 5; } } public class b : { public override int getnum() { homecoming 12; } }

c# inheritance xna

No comments:

Post a Comment