There are 21 boys in the class.
Basically, solve what you have there with cross-multiplication.
2x = 14 x 3
2x = 42
Then divide both sides by 2. (edited it bc didn't say what you actually had to do)
2x ÷ 2 = 42 ÷ 2
x = 21.
There are 21 boys in the class.