List Info

Thread: C-Sharp (C#) Group: Inheritance




C-Sharp (C#) Group: Inheritance
user name
2006-05-08 19:48:15
Hi All
 
I have a question on Inheritance
 
I have an abstract class Shape with two properties int X and int Y
I have a concrete class Triangle which inherits Shape
Triangle class has an additional property Y
 
 
abstract class Shape
{
  public int x,
 public   int y
}
 
class triangle : Shape
{
 public  int y;
}
 
 
When i say Shape S = new Triangle();
I expect to see the properties X,Y and Z......But i only see X and Y....
 
I am confused
Please explain..

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "C-Sharp (C#)" group.
To post to this group, send email to C_Sharpgooglegroups.com
To unsubscribe from this group, send email to C_Sharp-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/C_Sharp
-~----------~----~----~----~------~----~------~--~---

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )