4. (10 points) The number of students in Xiaoming's class is less than 40, but more than 30. Therefore, the ratio of boys to girls in the class cannot be ( )
A. 2: 3
B. 3: 4
C. 4: 5
D. 3: 7
【Analysis】First, consider the ratio as parts, find out the total number of people in terms of parts, since the number of people must be an integer, the total number of people must be a multiple of the total parts. Identify the option where there is no multiple of the total parts in the numbers greater than 30 and less than 40 to solve the problem.

【Solution】Solution: $A: 2+3=5$
Among the numbers greater than 30 and less than 40, 35 is a multiple of 5, so the ratio of boys to girls in this class could be $2: 3$;
$B: 3+4=7$
Among the numbers greater than 30 and less than 40, 35 is a multiple of 7, so the ratio of boys to girls in this class could be $3: 4$;
$C: 4+5=9$
Among the numbers greater than 30 and less than 40, 36 is a multiple of 9, so the ratio of boys to girls in this class could be $4: 5$;
D: $3+7=10$
Among the numbers greater than 30 and less than 40, there is no number that is a multiple of 10, so the ratio of boys to girls in this class cannot be 3:7; hence, the answer is: $D$.