title: Can't subtract one double from another?
body: <p>Im quite new to Java and programming in general, but Ive read up on it quite a bit. Im currently making my first real OOP- a calculator that can perform certain equations. 
  However, while trying to program something that would calculate the variance of a distribution -Heres the code:</p>
  
  <pre><code>void variance() {
    System.out.println("The variance of a distribution with x values of " + a + b + "and mean" 
                  + mean + "is " + a*a+b*b/2 - mean*mean); 
  }
  </code></pre>
  
  <p>I get the error </p>
  
  <blockquote>
    <p>Bad operand types for binary operator '-'
                       First type = string
                       Second type = double".</p>
  </blockquote>
  
  <p>I had previously stated that a, b and mean were doubles and had also stated how mean is calculated. I also tried changing <code>a*a+b*b/2</code> from a string to a double, but then realized that if i put any integers or doubles into where <code>a*a+b*b/2</code> (e.g. 2) but i get the same error.
  Any help would be much appreciated :)</p>