Tic-tac-toe game using Java

Tic-tac-toe (also known as noughts and crosses or Xs and Os) 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.

For more information on tic-tac-toe please read https://en.wikipedia.org/wiki/Tic-tac-toe

Here we will see how this game can be constructed using Java language. If you find that this code example could be improved any way please let me know