C#將對(duì)象作為參數(shù)傳遞到其他方法
提問(wèn)人:劉冬梅發(fā)布時(shí)間:2020-10-13
public class Test1
{
public string str = "aaa";
public void f(Test1 test)
{
str = "bbb";
Console.WriteLine(test.str);
}
public void f1()
{
f(this);
}
public static void Main()
{
Test1 test = new Test1();
test.f1();
}
}
繼續(xù)查找其他問(wèn)題的答案?
相關(guān)視頻回答
點(diǎn)擊加載更多評(píng)論>>