In a "sense" yes. You exercise self-control to refuse to do
something you desire. Then you will reflect on why you do it. Is it
"right" or "wrong"? How you justify your decision to do so and
otherwise. THe next time can you do it again or will you do the
other way?
All these and more, you learn more, you grow, you understand more
and somehow you mature more.