Code example for RuntimeException

0
    eatChar(delimiter);
  } 
 
  public void eatChar(char target) {
    if(pos < len && line[pos] != target) {
      throw new RuntimeException("expected [" + target + "] but got " + line[pos] + " in [" + new String(line, pos, len - pos) + "]");
    } 
    pos++;
  } 
 
  public boolean hasMore() { 
    return pos < len;
  } 
}