title: Multi-threading to print even and odd numbers in java?
body: <p>I'm a little confused about the difference between threading and multi-threading in Java as far as syntax. I need to write a program to print even numbers 0 to 30 and then odds using threading and another program to do the same thing using multi-threading. I wrote a program that runs and does what it's supposed to but I don't know whether it's threading or multi-threading, or how to go about doing the one it isn't. Here is my program-</p>
  
  <pre><code>public class OddEven extends Thread {
  public static void main(String args[]){
      Runnable r1 = new Runnable1();
      Thread t1 = new Thread(r1);
      Runnable r2 = new Runnable2();
      Thread t2 = new Thread(r2);
      t1.start();
      t2.start();
    }
  }
  class Runnable1 implements Runnable{
  public void run(){
      for(int i=0; i&lt;=30; i+=2) {
          System.out.println(i);
      }
    }
  }
  class Runnable2 implements Runnable{
  public void run(){
      for(int i=1; i&lt;=30; i+=2){
          System.out.println(i);
      }
    }
  }
  </code></pre>
  
  <p>Would this program be considered just a single thread? </p>
  
  <pre><code>public class OddEven {
  public static void main(String args[]){
      for(int i=0; i&lt;=30; i+=2) {
          System.out.println(i);
      }
      for(int i=1; i&lt;=30; i+=2){
          System.out.println(i);
      }
  }
  </code></pre>
  
  <p>}</p>