title: get the value in override method using object oriented
body: <p>here is the class that extends CountDownTimer.</p>
  
  <pre><code>public class timer extends CountDownTimer{
  
  private final long startTime = 50000;
  private final long interval = 1000;
  int timeElapsed;
  
  public timer(long starttime, long interval){
      super(starttime, interval);     
  }
  
  @Override
  public void onFinish() {        
  
  }
  
  @Override
  public void onTick(long millisUntilFinished) {
      timeElapsed = (int)(startTime - millisUntilFinished);       
  }   
  </code></pre>
  
  <p>}</p>
  
  <p>here is the main class.</p>
  
  <pre><code>long millisUntilFinished = 0;
          timer myTime = new timer(5000, 1000);
          myTime.onTick(millisUntilFinished);
  
          if(myTime.onTick(millisUntilFinished) == 2000){
              //do the next process
          }
  </code></pre>
  
  <p>This code tells </p>
  
  <blockquote>
    <p>the operator == is undefined for thee type(s) void, int</p>
  </blockquote>
  
  <p>how i want to get the value timeElapsed that is in the override method and the value can be used in the main class for the next process.</p>
  
  <p>please help me to resolve this. thanks for advance.</p>