4. Among the integers between 1000 and 9999, the number of four-digit integers with all different digits, where the absolute difference between the first and last digit is 2, is
A. 672
B. 784
C. 840
D. 896
4. C First, consider how many pairs of numbers in the set $\{0,1, \cdots, 9\}$ have a difference of $\pm 2$.

Obviously, there are 16 pairs: $(0,2),(2,0),(1,3),(3,1),(2,4),(4,2), \cdots,(7,9),(9,7)$. Except for $(0,2)$, all of these can be used to form the required number.

Since the requirement is that the digits of the four-digit number must all be different, the possible scenarios for the middle two digits are $8 \cdot 7=$ 56 in total.
Therefore, the total number of numbers that meet the requirement is $15 \cdot 56=840$.
Hence, the answer is C.