title: Creating a list in Apex
body: <p>I have made this list and its suppose to return all the users that are active but I dotn know why the for loop is wrong. do I need a Set?</p>
  
  <p>public with sharing class ActiveAgents {</p>
  
  <pre><code>    public ActiveAgents() {
          User U = new User();
          List&lt;User&gt; ActiveUser = [SELECT Name , UserName, LastName
                                   FROM User
                                   WHERE IsActive = true];
  
          for (User currentUser : ActiveUser){
  
  
              U.add(currentUser.Name);
              U.add(currentUser.Username);
          }
  
      }
  } 
  </code></pre>