title: The primitive type double of a does not have a field
body: <p>Sorry for this basic question, I have tried to check other answers on SO but they haven't been convincing. My code is plain and simple but I do not understand why do I have compiling errors.</p>
  
  <p>Can someone explain this in layman terms? It would be very helpful.</p>
  
  <pre><code>public class gravityCalculator 
  
  public static void main(String[] args) {
      // TODO Auto-generated method stub
      double g= -9.81;
      double u= 0.0;
      double t= 10.0;
      double x_i =0;
      double s;
      double a=0;
      if(a&lt;=0){
          a=g;
      }
      //System.out.println(a);
      s= 0.5+a.t^2+u.t+x_i;
  }
  }
  </code></pre>
  
  <p>Error Trace</p>
  
  <pre><code> Exception in thread "main" java.lang.Error: Unresolved compilation problems: 
      The primitive type double of a does not have a field t
      The primitive type double of u does not have a field t
  </code></pre>
  
  <p>Edit: This question can also be useful to know about the difference between Datatype and an Object.
  Solution : s= 0.5*a*t * t+u*t+x_i;</p>