title: How to finish Thread_Square first then Thread_Cube
body: <p>Anyone can help me..
  How to get output like this</p>
  
  <hr>
  
  <p>Square Number</p>
  
  <p>Insert Number to get Value of Square: 2</p>
  
  <p>Square of number 2 is 4</p>
  
  <p>Cube Number</p>
  
  <p>Insert Number to get Value of Square: 3</p>
  
  <p>Square of number 3 is 27</p>
  
  <hr>
  
  <p>now I get output like this</p>
  
  <hr>
  
  <p>Square Number</p>
  
  <p>Insert Number to get Value of Square: Square Cube</p>
  
  <p>Insert Number to get Value of Cube: 2</p>
  
  <p>Square of number 2 is 4</p>
  
  <p>3</p>
  
  <p>Cube of number 3 is 27</p>
  
  <hr>
  
  <p>here my coding</p>
  
  <pre><code>    import java.io.BufferedReader;
      import java.io.IOException;
      import java.io.InputStreamReader;
      import java.util.logging.Level;
      import java.util.logging.Logger;
  
  
      class Thread_Square extends Thread{
  
       private int sumSquare;
  
       public void Thread_Square(){
  
               BufferedReader square = new BufferedReader(new InputStreamReader(System.in));
               System.out.println("Square Number");
               System.out.print("Insert Number to get Value of Square: ");
  
               String inputSquare = null;
               try {
                   inputSquare = square.readLine();
               } catch (IOException ex) {
                   Logger.getLogger(Thread_Square.class.getName()).log(Level.SEVERE, null, ex);
               }
               int numSquare = Integer.parseInt(inputSquare);
  
               sumSquare=numSquare*numSquare;
  
               System.out.println("Square of number " +numSquare +" is " +sumSquare);
  
  
        }
           public void run()
          {
  
              Thread_Square();
  
  
          }
      }
  
      class Thread_Cube extends Thread{
  
         public void Thread_Cube(){
            int sumCube;
               BufferedReader Cube = new BufferedReader(new InputStreamReader(System.in));
              System.out.println("Square Cube");
               System.out.print("Insert Number to get Value of Cube: ");
  
               String inputCube = null;
               try {
                   inputCube = Cube.readLine();
               } catch (IOException ex) {
                   Logger.getLogger(Thread_Square.class.getName()).log(Level.SEVERE, null, ex);
               }
               int numCube = Integer.parseInt(inputCube);
  
               sumCube=numCube*numCube*numCube;
  
               System.out.println("Cube of number " +numCube +" is " +sumCube);
  
      }
  
          public void run()
          {
                Thread_Cube();
  
  
          }
      }
  
      class Thread_Question1 {
  
          public static void main(String[] args) throws IOException {
  
  
              Thread_Square obj1 = new Thread_Square();
              obj1.start();
  
  
             Thread_Cube obj2 = new Thread_Cube();
              obj2.start();
  
  
          }
      }
  </code></pre>