简体   繁体   中英

What does the “Assigned value is never used” warning mean?

unformatted = unformatted.replaceAll(seperator, "\n");

Netbeans gives me the warning:

The assigned variable is never used

What does this mean?

It means that you're not doing anything with that variable after you assigned a value to it. For example, you are not returning it, performing a calculation with it, passing it to a method, or anything else. It basically means that the variable has not been used after a value has been assigned to it.

它只是一个标准规则,您的IDE一直在检查,以帮助您避免不必要的变量声明维护干净的代码。

The assigned variable is never used

The line itself self explaining.

Its because unformatted is initialized, but is never used, making the initialization unnecessary.

It helps you out to make your code cleaner and to get rid doff from unnecessary memory waste .

在为其赋值后,您还没有使用过该变量

它只是意味着你的unformatted变量永远不会被读取。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM