public class mpe
{
private string _e1;
private string _e2;
public mpe()
{
}
public mpe(string e1,string e2)
{
this._e1 = e1;
this._e2 = e2;
}
public String e1
{
get
{
return "hello";
}
}
}
调用的时候:
return new mpe(e1, e2); 为什么这样调用就可以返回hello呢?
==================================我找到的第二种 写法。
public class mpe
{
private string _e1;
private string _e2;
public mpe()
{
}
public mpe(string e1,string e2)
{
this._e1 = e1;
this._e2 = e2;
}
public String e1_A
{
get
{
return "hello";
}
}
}
mpe mpe1= new mpe("**", "***");
string aa = mpe1.e1_A;
如果我用return new ("***","***")可不是不是也返回hello呀,为什么,我是个初学者
{
private string _e1;
private string _e2;
public mpe()
{
}
public mpe(string e1,string e2)
{
this._e1 = e1;
this._e2 = e2;
}
public String e1
{
get
{
return "hello";
}
}
}
调用的时候:
return new mpe(e1, e2); 为什么这样调用就可以返回hello呢?
==================================我找到的第二种 写法。
public class mpe
{
private string _e1;
private string _e2;
public mpe()
{
}
public mpe(string e1,string e2)
{
this._e1 = e1;
this._e2 = e2;
}
public String e1_A
{
get
{
return "hello";
}
}
}
mpe mpe1= new mpe("**", "***");
string aa = mpe1.e1_A;
如果我用return new ("***","***")可不是不是也返回hello呀,为什么,我是个初学者
解决方案 »
- winform里的groupbox的背景色问题!!!
- 帮忙看下这段代码对不对
- 疑似IE7的一个BUG,大家帮忙看看
- 急救!!!!ASP.NET2005,Session问题
- sql如何选择一列中id不同的记录?
- 把owc的sreadsheet拖到web上为什么只在web页上有了一个<object>但namespace里没有创建 spreadsheet1 的实体
- 貌似是castle报错
- JSON转换问题
- 在考虑下学期和未来的计划,请各位大虾进来看看给点意见。~~~~~~~~~~~~~~~~~
- 这个栏目为什么没有放入web开发里面?
- 急求救一个Datagrid分页问题大虾速来.....
- 跨瀏覽器(Safari) 的JavaScript問題
==================
1。
LZ 你神人也,按我理解,这样是返回一个 mpe 实例,
返回 hello ?我的真愚昧了,不知道为什么会这样子。
哪里冒出来的 e1, e2 ???如果我用return new ("***","***")可不是不是也返回hello呀
================
2。
a. LZ 你要 new 谁呢? new 一个怪物出来吗?
b. "可不是不是" 这个N关,地球人看不懂3。
LZ 的两种定义的方法有什么不一样吗?
--------------------不可能返回hello吧。