public char charAt(int index){
  if (index < 0 || index >= nextFencePost)   return 0;
  return s.charAt(index);
}

public char charAt ( int index ) { if ( index < 0 || index >= nextFencePost ) return 0 ; return s . charAt ( index ) ; }
returns the character at given offset without changing the scanners state . if offset is out of bound , 0 is returned .
