为什么下面给我一个“局部变量是多余的错误”?publicdoubledepreciationAmount(){doubledepreciationAmount=(cost*percentDepreciated);returndepreciationAmount;} 最佳答案 Whyisthefollowinggivingmea"localvariableisredundanterror"?因为您可以在不使用局部变量的情况下简单地编写它。publicdoubledepreciationAmount(){returncost*perce