我的代碼就像下面的一個C#遞歸方法,如何從具有返回類型
public object GetObjectValue(object obj, int condition)
{
if(condition > 10)
{
//exit from method
// return; gives compiler error.
}
else
{
GetObjectValue(obj,condition); // like this i need to use recursive call.
//Do stuffs
}
}
如何從這種方法退出退出。幫我。
最重要的問題:你想做什麼? – Kobi 2011-05-12 05:31:52
你得到的錯誤是什麼? – Shekhar 2011-05-12 05:33:29