110,534
社区成员
发帖
与我相关
我的任务
分享
namespace Proj6_8_3
{
class A
{
string stra = "A";
public class B
{
public void disp()
{
Console.WriteLine(stra);//这行报错.
}
}
}
class Program
{
static void Main(string[] args)
{
A.B b = new A.B();
b.disp();
}
}
}
class A {
public string stra = "A";
public class B {
public void disp() {
Console.WriteLine(new A().stra);
}
}
}
public class Program
{
static void Main(string[] args)
{
A.B aa = new A.B();
aa.disp();
}}
这样写可以也!! class A
{
const string st = "aaa";
public class B
{
public void show()
{
MessageBox.Show(st);
}
}
}
公历→农历
2013年06月05日
双子座
二〇一三年四月廿七
癸巳〖蛇〗 丁巳月 壬寅日 庚戌时
namespace ConsoleApplication1
{
class A
{
string st = "aaa";
public class B
{
public void show()
{
Console.WriteLine("test");
Console.ReadKey();
}
}
}
class Program
{
static void Main(string[] args)
{
A.B aa = new A.B();
aa.show();
}
}
}
测试没有任何问题