Step 1: Understanding the Concept
Mendel needed pure (true breeding) lines before crossing, plants that give offspring identical to themselves.
Step 2: How he obtained them
He let the selected pea plants self-pollinate for generations until the traits stayed constant.
The textbook mentions two years (two generations) of selfing to confirm purity.
Step 3: Compare the options
The number of generations stated is 2, which is option (A).
Final Answer:
Mendel selfed the plants for 2 generations.
\[ \boxed{\text{(A) }\text{2}} \]