我不能在該方法使用相同的參數DetermineCarValue我不能在方法中使用相同的參數。 CS0136
public static decimal DetermineCarValue(Car carValue)
{
decimal carValue = 100.0M;
return carValue;
}
當我鍵入carValue參數我得到這個錯誤
CS0136 A local or parameter named 'carValue' cannot be declared in this scope because that name is used in an enclosing local scope to define a local or parameter
錯誤不是很明顯嗎? – haim770
你有'carValue'作爲'Car'類型的參數和''decimal'類型的本地。你必須爲其中一個選擇一個不同的名字。 –
你是說在粘貼到問題框之前,你甚至沒有閱讀錯誤信息? –