Since you are only reading the elements of the Set, I would recommend a for-each loop, which is basically the same as your code (the first snippet) but has been designed for this kind of situations (and is more readable IMO).
HashSet<String> vectors = new HashSet<String>();
for(String temp : vectors){
System.out.println("Next element inside HashSet is " + temp);
out.write(temp + "\n");
}