The whole for statement is wrong!
Can you explain what you trying to achive?
peter_budo
Code tags enforcer
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
Do you have any specific reason to change from List to Array? I think that data are better kept in List which can dynamicaly grow then in fix size array...
peter_budo
Code tags enforcer
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
if( m.group(2).equalsIgnoreCase("NN"))
{
list = m.group(1);
Set<String> s = new HashSet<String>();
if(!s.add(list))
System.out.println("Dups" +list);
return list;
}
list is a variable tat contains list of strings.
I want to check duplicates in that variable.
but here its not printing any..
Can anyone figure or suggs pls.
"list" looks to be a single string here. Not sure why you call it a list. Also, you are creating a new Set before you add "list" to it. It's not going to contain dupes if you only added one thing to it. Not sure why are you returning from the method in the middle of your if statement either.
Ezzaral
Posting Genius
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847