C#速成(Quick C#)
-------------------
调用基类成员
-------------------
如果子类与基类有同名的数据成员,为避免命名冲突,访问基类数据成员和函要使用一个关键字base。在下面的示例中我们来看看如何调用基类的构造函数以及如何使用数据成员。
public Child(int val) :base(val)
{
myVar = 5;
base.myVar;
}
或者
public Child(int val)
{
base(val);
myVar = 5 ;
base.myVar;
}
--------------------------------
将来的补充:
本文仅是一个C#语言的快速概览,以便你能熟悉此语言的特点。虽然我已经尽力以简明而全面的代码例示方式讨论所有主要的C#概念,我认为要填加讨论的还有很多。
将来我会加入更多还没有讨论的命令和概念,比如事件等等。我也想写些有关C#初学者进行Windows编程的东东。
参考资料:16240
our most commonly known MSDN
Inside C# by Tom Archer
A Programmer's Introduction to C# by Eric Gunnerson
Beginning C# by Karli Watson
Programming C# (O'Reilly)
About the Author
Aisha is a Master of Science in Computer Science from Quaid-i-Azam Univeristy. She has worked in VC++ 6, MFC, ATL, COM/DCOM, ActiveX, C++, SQL, and so forth. These days she is working on .NET framework and C#. Inspired with nature, she loves to seek knowledge. She is also fond of travelling. She keeps a free source code and articles Web site at http://aishai.netfirms.com.
History
Date Posted: June 13, 2003
- 上一篇文章:中国人的小聪明
- 下一篇文章:asp.net使用常见问题
相 关 文 章
相 关 软 件
本站搜索(搜索结果将在新窗口打开)
