public boolean isDuplicate(String soc, int plc) { // Result of false desired boolean b; for (int c = 1; c < plc; c++) { if (socialArray[c].equals(soc)) { b = true; if (b) { return true; } } else { b = false; } if (!b) { for (c = plc + 1; c < socialArray.length; c++) { if (socialArray[c].equals(soc)) { b = true; if (b) { return true; } } else { b = false; } } } } return false; }