title: Finding duplicate values in row with Java
body: <p>So I've a file with these rows</p>
  
  <pre><code>155, 490, 297, 490,
  -45, 19, 45, 19,
  -24, 80,-12,-69, 80,
  12,-92, 28,-40,
  </code></pre>
  
  <p>I try to read the file and find these rows which contain duplicate elements. But something with my logic is wrong and I can't find the error. Any help ?</p>
  
  <p>Here is the code: </p>
  
  <pre><code>public static void main(String[] args) throws IOException {
          Scanner fileInput = null;
          try {
              fileInput = new Scanner( new File("array_list.csv"));
              String line;
              while (fileInput.hasNextLine()) {
                  line = fileInput.nextLine(); 
                  String[] lineArr = line.split(",");
                  // check for missing values
                  boolean contains = true;
                  for(int i=0; i&lt;lineArr.length; i++) {
                      for(int j=0; j&lt;lineArr.length; j++) {
                          if(lineArr[i]==lineArr[j]) {
                              contains = false;
                              break;
                          }
                      }
                      if(!contains) {
                          // print the row .....
                      }
                      else {
                          contains = true;
                          // print some thing ...
                      }
                  }
              }
              } finally {
              if (null != fileInput) {
                  fileInput.close();
              }
          }
      }
  </code></pre>