title: Java: Can't get incremented value to print.
body: <p>I'm learning to do some Java 101 syntax stuff. In an exercise I'm trying to do, I can't get the incremented value to print. Any ideas? </p>
  
  <p>Here is my code: </p>
  
  <pre><code>class StaticTest { 
      static int i = 47;  
  }
  class incrementable { 
      static void increment() { StaticTest.i++; } 
  }
  
  class DataOnly { 
  
      int i;
      double d;
      boolean b; 
  
      public static void main (String[] args) { 
          incrementable t = new incrementable(); 
          DataOnly df = new DataOnly(); 
          df.i = t.increment(); 
          System.out.println(df.i);
      } 
  
  }
  </code></pre>
  
  <p>The error I get is: </p>
  
  <pre><code>aTyp0eName.java:18: incompatible types
  found: void 
  required: int 
  df.i = t.increment(); 
  </code></pre>
  
  <p><code>df.i</code> is an <code>int</code> and so is <code>t.increment</code>.  I'm guessing it's because <code>increment()</code> is <code>void</code>? </p>