Advertisement
Guest User

Untitled

a guest
May 1st, 2013
2,783
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. public boolean isDuplicate(String soc, int plc) { // Result of false desired
  2.  
  3.         boolean b;
  4.  
  5.         for (int c = 1; c < plc; c++) {
  6.             if (socialArray[c].equals(soc)) {
  7.                 b = true;
  8.                 if (b) {
  9.                     return true;
  10.                 }
  11.             } else {
  12.                 b = false;
  13.             }
  14.             if (!b) {
  15.                 for (c = plc + 1; c < socialArray.length; c++) {
  16.                     if (socialArray[c].equals(soc)) {
  17.                         b = true;
  18.                         if (b) {
  19.                             return true;
  20.                         }
  21.                     } else {
  22.                         b = false;
  23.                     }
  24.                 }
  25.  
  26.             }
  27.  
  28.         }
  29.         return false;
  30.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement