title: How can I find the result of a Bool ArrayList comparing its Bool values?
body: <p>If I have an <code>ArrayList</code>  include <code>boolean</code> values, what is the best way to find out the result of this sequence of Bool values ?</p>
  
  <p>I was trying something like this</p>
  
  <pre><code>bool result = false;    
  bool flag = false;
  ArrayList flags = new ArrayList();
  
  if (something &gt; 5)
  {
   flag = true;
  }
  flags.Add(flag);    
  
  foreach (bool val in flags)
  {
        result &amp;= val;
  }
  </code></pre>
  
  <p>However if I would declare the result variable as true instead of false, then this changes the result. I am a bit confused.</p>
  
  <p>Any advice would be appreciated!</p>