It is given that,
John has 4 different flags that he wants to hang on the wall.
To find the number of different ways can the flags be arranged in a row:
There are 4! ways can the flags be arranged in a row.
That is,
[tex]\begin{gathered} 4!=4\times3\times2\times1 \\ =24 \end{gathered}[/tex]Hence, the answer is 24 different ways.