Let \((G,\ast)\) and \((H,\circ)\) be two groups, and let $G\times H$ by the cartesian product of the sets $G$ and $H$, i.e. the set of all pairs $(g,h)$ with $g\in G$ and $h\in H$. Let a binary operation "$\cdot$" on such pairs be defined by $$(g_1,h_1)\cdot (g_2,h_2):=(g_1\ast g_2,h_1\circ h_2).$$
Then the set $(G\times H,\cdot)$, called the direct product of the groups $G$ and $H$, is a group and with the identity element $(e_G, e_H)$ (where $e_G$ is the identity of $G$ and $e_H$ is the identity of $H$) and with the inverse elements $(g^{-1},h^{-1})$ for all $(g,h)\in G\times H$.
More generally and similarily, let $(G_1,\ast_1), (G_2,\ast_2),\ldots (G_n,\ast_n)$ be groups. Then the direct product $(G_1\times G_2\times\ldots\times G_n,\cdot)$ is a group with the binary operation "$\cdot$" defined on the $n$-tupels $$(g_1,g_2,\ldots,g_n)\cdot (g'_1,g'_2,\ldots,g'_n):=(g_1\ast_1 g'_1,g_2\ast_2 g'_2,\ldots,g_n\ast_n g'_n)$$ with the identity element $(e_1,\ldots,e_n)$ ($e_i$ being the identity of $G_i$) and the inverse elements $(g^{-1}_1,\ldots,g^{-1}_n)$ for all $(g_1,\ldots,g_n)\in G_1\times G_2\times\ldots\times G_n$.
Examples: 1