import java.io.Serializable;
  public class Accomplice {
  
  /**
  * @param args
  */
  public static void main(String[] args) {
  // TODO Auto-generated method stub
  Data d=new Data();
  System.out.println(d.getS(4));
  System.out.println(Data.count);
  System.out.println(d.getS(3));
  System.out.println(Data.count);
  
  
  }
  
  }
  final class Data implements Serializable
  {
  public static int count=0;
  
  public Data()
  {
  Data.counter();
  }
  private static void counter()
  {
  count=count+1;
  if(count>=2)
  {
  s=null; 
  }
  }
  private static String s="abc";
  public String getS(int key)
  {
  if(key==3)
  {
  Data.counter();
  return s;
  }
  else
  {
  Data.counter();
  return "try again";
  }
  }
  
  }
  
Hi all see if you can hack to the Data i call it the tapeworm concept.
   
   
  Thanks 
  Regards
  Shivakanth


       
---------------------------------
Luggage? GPS? Comic books? 
Check out fitting  gifts for grads at Yahoo! Search.

Reply via email to