  We establish a Liouville type result for stable solutions for a wide class of
second order semilinear elliptic equations in $\mathbb{R}^{n}$ with
sign-changing nonlinearity $f$. Under the hypothesis that the equation does not
have any nonconstant one dimensional stable solution, and a further
nondegeneracy condition of $f$ at its zero points, we show that in any
dimension, stable solutions of the equation must be constant. This partially
answers a question raised by Dancer.
