I am trying to answer questions in Stack Overflow, but I did answer wrong for the most.
I currently have one year of experience in programming, still, how many years of experience are needed to answer these questions that arise on Stack Overflow?
Meta Stack Exchange is a question and answer site for meta-discussion of the Stack Exchange family of Q&A websites. It only takes a minute to sign up.Sign up to join this community
10 years or so - details at http://norvig.com/21-days.html . Good read.
There are going to be some questions for which you know the answer based on your current experience - the question is about a programming language you know, maybe on a system you know, and perhaps it is a problem you yourself have encountered and resolved. Even a 1 month newbie to programming might be able to answer the question with good insight into a problem that someone else (perhaps another newbie) ran into - and people with more experience may never have even thought about running into problems that way.
There are going to be other questions for which your experience is a less perfect fit, but for which you may well be able to give helpful pointers. Sometimes, researching an answer will give you valuable experience and knowledge - plus you can read the contributions of other people who know the answer. Again, you don't need a specific amount of experience to be able to answer such questions - you need an 'can do' attitude and willingness to do the research necessary to come up with the answer.
As the topics drift further from your current areas of experience, they get harder to answer based on your current experience. If you know Java but don't know C, it will be hard for you to answer questions on C. This is reasonable; don't try to answer such questions.
Use the tagging system - interesting tags in particular - to ensure you see the questions in the areas you know about, but also to see questions in areas you don't yet know about.
You will be in the 'learning phase' of your programming career for the next 25 years at least (I've been doing programming professionally for over 25 years - and I'm still learning most days; it is arguably a day wasted when I don't learn something new).
So, the direct answer to your question is:
There is no substitute for experience. But you don't have to have much experience in the general world of programming to be able to answer specific questions in the areas where you do have experience.