Eight queens problem java implementation