Let the total number of boys in the class be \( N \).
We are given that one boy is seventeenth in order from both the ends.
If a boy is seventeenth from the front, it means there are \( 17 - 1 = 16 \) boys standing before him.
If the same boy is seventeenth from the back, it means there are \( 17 - 1 = 16 \) boys standing after him.
The total number of boys in the class is the number of boys before him, plus the boy himself, plus the number of boys after him.
$$ N = (\text{Number of boys before him}) + (\text{The boy himself}) + (\text{Number of boys after him}) $$
$$ N = 16 + 1 + 16 $$
$$ N = 33 $$
Therefore, there are 33 boys in the class.
We can also think of this as:
Position from the front + Position from the back - 1 = Total number of items.
Here, the position from the front is 17, and the position from the back is 17.
Total number of boys \( = 17 + 17 - 1 = 34 - 1 = 33 \).