作者aesee (jo3)
看板C_Sharp
标题Re: [问题] 有那位大大能帮小弟解决这个问题?
时间Wed Apr 5 21:35:52 2006
※ 引述《smallanghome (良仔)》之铭言:
: 我执行到o5後就印不出来了,谁能帮我解决这个问题...感激不尽!
: class Program: {
: 原文~~~略~~~^^
: }
以下是我的 哈哈~~~
namespace week062
{
class week062
{
static void Main(string[] args)
{
A o1 = new A();
A o2 = new A(3);
A o3 = new A(10,2.3);
A o4 = new A("Hello");
A o5 = new A(o4);
A o6=o5;
Console.WriteLine("o6 a({0})", o6);
}
class A
{
public A()
{
Console.WriteLine("o1 a()");
}
public A(int a)
{
Console.WriteLine("o2 a({0})",a);
}
public A(int a,double b)
{
int x = a;
double y = b;
Console.WriteLine("o3 a({0},{1})",a,b);
}
public A(string a)
{
Console.WriteLine("o4 a({0})",a);
}
public A(A b)
{
Console.WriteLine("o5 a({0})", b);
}
}
}
}
我的可以跑完没出现错误
不过有一点我不太清楚
就是o5跟o6印出来的资讯都是"week062.week062+A"
这是代表什麽意思勒 @.@"
我有用f11看过里面的数据
好像重载一次,上一个就会变成"week062.week062+A"耶!
最後~~我想说~~学弟考试加油阿~~哈哈~~
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 59.113.52.185
※ 编辑: aesee 来自: 59.113.52.185 (04/05 22:02)