title: hashset input java
body: <p>Im working on the question below and am quite close but in line 19 and 32 I get the following error and cant figure it out.</p>
  
  <blockquote>
    <p>foreach not applicable to expression type
            for (String place: s)</p>
  </blockquote>
  
  <p><strong>Question:</strong></p>
  
  <blockquote>
    <p>Tax inspectors have available to them two text files, called unemployed.txt and taxpayers.txt, respectively. Each file contains a collection of names, one name per line. The inspectors regard anyone who occurs in both files as a dodgy character. Write a program which prints the names of the dodgy characters. Make good use of Java’s support for sets. </p>
  </blockquote>
  
  <p><strong>My code:</strong></p>
  
  <pre><code>class Dodgy {
  
  public static void main(String[] args) {
  
      HashSet&lt;String&gt; hs = new HashSet&lt;String&gt;();
  
      Scanner sc1 = null;
  try {sc1 = new Scanner(new File("taxpayers.txt"));} 
          catch(FileNotFoundException e){};
  while (sc1.hasNextLine()) {
      String line = sc1.nextLine();
      String s = line;
      for (String place: s) {
          if((hs.contains(place))==true){
              System.out.println(place + " is a dodgy character.");
      hs.add(place);}
      }   
  }
  
      Scanner sc2 = null;
  try {sc2 = new Scanner(new File("unemployed.txt"));} 
          catch(FileNotFoundException e){};
  while (sc2.hasNextLine()) {
      String line = sc2.nextLine();
      String s = line;
      for (String place: s) {
          if((hs.contains(place))==true){
              System.out.println(place + " is a dodgy character.");
      hs.add(place);}
  }
  }
  }
  }
  </code></pre>