Example 10 How many 4-digit numbers can be formed by using the digits 1 to 9 if repetition of digits is not allowed?