0

I always see in many codes:

@SuppressWarnings("unused")

How can I remove these lines I use in java (in the NetBeans IDE):

@SuppressWarnings("unused")
String newName1 = input.next();         
@SuppressWarnings("unused")
String newFamily1 = input.next();           
String newGender1 = input.next();           
@SuppressWarnings("unused")
String arrow = input.next();        
@SuppressWarnings("unused")
String newName2 = input.next();         
@SuppressWarnings("unused")
String newFamily2 = input.next();
String newGender2 = input.next();
jvdhooft
  • 657
  • 1
  • 12
  • 33
Mohammad Olfatmiri
  • 1,605
  • 5
  • 31
  • 57
  • Delete them. All they are is a hint to the IDE that the local variable is never referenced again. IMO if you're not using them it's a bit misleading to have variables--why not use a real parsing library? – Dave Newton Jul 08 '12 at 15:46

2 Answers2

1

If you don't actually need the variable and you're just trying to advance input just call input.next() and don't assign it to anything.

Jeff Storey
  • 56,312
  • 72
  • 233
  • 406
0

Search for it and replace all with ""

Razvan
  • 9,925
  • 6
  • 38
  • 51
  • You mean execution errors : As far as I can see, you use input.next(). That looks like an Iterator/StringTokenier and it means that you're trying to go beyond the Iterator/StringTokenizer limit. Use if(input.hasNext()/input.hasMore()) newFamily2 = input.next(); – Razvan Jul 08 '12 at 15:43