title: Thread Lifecycle
body: <ol>
  <li>Create a Student class with name, mark1, mark2, mark3 and sum variables.</li>
  <li>Create an ArrayList with 4 student objects with some values.</li>
  <li>Create a MarkEvaluation thread and ShowMark thread. </li>
  <li>MarkEvaluation should perform the calculation of the total marks for each student.</li>
  <li>ShowMark thread should display the calculated sum.</li>
  <li>Use the join method to prevent the ShowMark thread to run before MarkEvaluation.</li>
  </ol>
  
  <p>Its not homework.Part of some practice am doing.Here they asked me to run 2 threads doing different things but I don't know if we can run 2 run() methods.How can I perform 2 different operations? Sorry am just starting to learn threads.This is what I've done but it is incomplete.</p>
  
  <pre><code>import java.util.*;
  
  class Student implements Runnable
   {
   public Student()
   {
       List&lt;Object&gt; list = new ArrayList&lt;Object&gt;();
       list.add("robin");
       list.add("ravi");
       list.add("raj");
       list.add("sam");
   }
   String name;
   int mark1=30,mark2=45,mark3=70,sum=0;
  
   public void run()
    {
      sum = mark1+mark2+mark3;
    }
  
  }
  
  public class Ch3Lu2Ex3
   {
    public static void main(String[] args) 
    {
      Student stu = new Student();
      Thread MarkEvaluation = new Thread(stu);
      MarkEvaluation.start();
      Thread ShowMark = new Thread();
  
  }
  }
  </code></pre>