title: If statement inside for loop Java
body: <p>I wanna know where I went wrong with my logic. I want to entire the for loop when found == true and do the condition else if not found i wanna execute that condition. Any help would be greatly appreciated.. </p>
  
  <pre><code>boolean found = false;
  
  for (String keyword : keywords) {
      found = true;
      if (input.contains(keyword)) {
          parseFile(keyword);
          break;
      }
      if (!found) {
          Writer();
          break;
      }
  }
  </code></pre>