Regarding thread safe class..!
<p>I was going through the threads, but what I was not able to grasp is that about thread safe classes, I have one simple class below , please advise me how to make it thread safe...</p>

<pre><code>    class Emp implements Comparable
{
      String name,job;
      int salary;
      public Emp(String n,String j,int sal)
      {
         name=n;
         job=j;
         salary=sal;
       }
      public void display()
      {
        System.out.println(name+"\t"+job+"\t"+salary);
       }
      public boolean equals(Object o)
      {
          Emp p=(Emp)o;
          return this.name.equals(p.name)&amp;&amp;this.job.equals(p.job)           &amp;&amp;this.salary==p.salary;
       }
       public int hashCode()
       {
          return name.hashCode()+job.hashCode()+salary;
       }  
       public int compareTo(Object o)
       {
          Emp e=(Emp)o;
          return this.name.compareTo(e.name);
           //return this.job.compareTo(e.job);
          // return this.salary-e.salary;

        }
} 
</code></pre>
