I am stuck on a problem in having my counter increment. I'm not sure what I am doing wrong though. Sorry if this is a beginner mistake, but I have not found a solution where I understand or helps yet.
public static int duplicates(String[] text, int numWords){
int currentCount = 1;
for (int i=0; i<numWords-1; i++){
for (int j=i+1; j<numWords; j++){
if (text[i] == text[j]){
currentCount++;
}
}
}
return currentCount;
}