jobukkit
jobukkit

Reputation: 2670

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?

Upvotes: 3

Views: 42303

Answers (5)

dev2d
dev2d

Reputation: 4262

It is just a standerd rule which your IDE keeps checking just to help you avoid unwanted variable declarations maintainig clean code.

Upvotes: 3

sp00m
sp00m

Reputation: 48837

It just means that your unformatted variable get never read.

Upvotes: 1

Suresh Atta
Suresh Atta

Reputation: 122006

The assigned variable is never used

The line itself self explaining.

Its becauseunformatted 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.

Upvotes: 1

stinepike
stinepike

Reputation: 54722

You have not used the variable anywayere after assigning value to it

Upvotes: 1

Vivin Paliath
Vivin Paliath

Reputation: 95588

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.

Upvotes: 6

Related Questions