As matrix has total 3× 3 = 9 elements.
As each element can take 2 values (0 or 2)
∴ By simple counting principle we can say that total number of possible matrices = total number of ways in which 9 elements can take possible values = 29 = 512
Clearly it matches with option D.
∴ Option (D) is the only correct answer.