The variable 'MyException' is declared but never used

前端 未结 6 1955
迷失自我
迷失自我 2020-12-05 09:36

I need to clear this warning :

try
{
    doSomething()
}
catch (AmbiguousMatchException MyException)
{
    doSomethingElse()
}

The complier

6条回答
  •  醉梦人生
    2020-12-05 09:56

    The trouble is, you aren't using your variable MyException anywhere. It gets declared, but isn't used. This isn't a problem... just the compiler giving you a hint in case you intended to use it.

提交回复
热议问题