OOP

摘要: 在.net下如下的代码是允许的 class Program { static void Main(string[] args) { B b = new B(); b.X = 20; b.Print(b); Console.ReadLine(); } } class A { int x; public void Print(B b) { Console.Write(b.x); //可以通过编译 }...阅读全文
posted @ 2006-10-21 22:35 Roland 阅读(68) | 评论 (0) 编辑
posted @ 2005-01-09 23:44 Roland 阅读(358) | 评论 (1) 编辑