Set of pairs, compilation error
<p>I want to know why this piece of code gets a compilation error. I'm new to JAVA. I wanted to make a Set of pairs as in C++
What is the meaning of <strong>pair</strong> in inner class code</p>

<pre><code>import java.io.*;
import java.util.Set;

public class UVa {
    public static boolean flag = false;
    public static Integer p0, p1;
    public static Set&lt;pair&lt;Integer,Integer&gt; &gt; sorter;

    public static class pair&lt;first,second&gt;{
        public first First;
        public second Second;
        private pair(first First,second Second){
            this.First = First;
            this.Second = Second;
        }
    }

    public static void main(String[] args) {
        try {
            while (true) {
                p0 = System.in.read();
                p1 = System.in.read();
                sorter.add(pair&lt;p0, p1&gt;); //&lt;&lt;Syntax error on token "&gt;", Expression expected after this token

            }
        } catch (IOException e) {
            System.out.println(e.toString());
        }
    }
}
</code></pre>
