Not able to understand Generic Methods
<p>I understand this statement  :-</p>

<p><code>List&lt;string&gt; a;</code></p>

<p>which means that a can contain values of only <code>string</code> type.</p>

<p>But when used with methods i get confused. For eg.</p>

<p><code>public T1 methodName &lt;T1,T2&gt;(T1 t, T1 p)</code></p>

<p>I understand the method is returning object of type <code>T1</code> and accepts objects of type T1. But what is the significance of <code>&lt;T1,T2&gt;</code>? Why is it required?</p>

<p><strong>Edit :-</strong>
Based on the answers i received, i guess <code>&lt;T1, T2&gt;</code> are there so that input arguments looks similar. If <code>&lt;T1&gt;</code> was there then all input arguments must be of type T1 and if <code>&lt;T1,T2&gt;</code> is there means all arguments must be of type either <code>T1</code> or <code>T2</code></p>

<p>But what exactly is meant by this statement :-</p>

<p><code>public static TSummary Accumulate &lt;TInput, TSummary&gt; (IEnumerable &lt;TInput&gt; coll, Action &lt;TInput, TSummary&gt; action)</code></p>

<p>The definition says all input must be of either <code>TInput</code> or <code>TSummary</code> but the second argument is of type <code>Action</code>. So i am still confused.</p>

<p>Thanks in advance :)</p>
