Tic-tac-toe game using Java

Tic-tac-toe (also known as noughts and crosses or Xs and Os, respectively) is a paper and pencil game for two players, X and O, who take turns marking the spaces in a 3×3 grid. The player who succeeds in placing three of their marks in a horizontal, vertical, or diagonal row wins the game. Here we will see how this game can be constructed using Java language. This program is written in core Java and there is no User Interface. So it is a console based program.