`
yanshaozhi
  • 浏览: 103325 次
  • 性别: Icon_minigender_1
  • 来自: 东营
社区版块
存档分类
最新评论

C# 接口

    博客分类:
  • c#
阅读更多
[modifiers] interface IName [: Interface [, Interfaces]]
{
// methods
// properties
// indexers
// events
}

看看C# 几口的定义  比起java 的却是要麻烦些  不过概念还是一样的

C#  构造函数重载

public class WebSite
{
string siteName;
string url;
string description;
// Constructors
public WebSite()
: this(“No Site”, “no.url”, “No Description”) {}
public WebSite(string newSite)
: this(newSite, “no.url”, “No Description”) {}
public WebSite(string newSite, string newURL)
: this(newSite, newURL, “No Description”) {}
public WebSite(string newSite,
string newURL,
string newDesc)
{
siteName    = newSite;
url         = newURL;
description = newDesc;
}
}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics