The energy \( E \) stored in an inductor is given by the formula:
\[
E = \frac{1}{2} L I^2
\]
where \( L \) is the inductance and \( I \) is the current. We are given \( E = 25 \, \text{J} \) and \( L = 2 \, \text{H} \), and we need to find \( I \). Substituting the values:
\[
25 = \frac{1}{2} \times 2 \times I^2
\]
Simplifying:
\[
25 = I^2
\]
Taking the square root of both sides:
\[
I = 5 \, \text{A}
\]
Thus, the current passing through the inductor is \( 5 \, \text{A} \).