Why I can't declare and run method in main method of Java class : <p>Probably I missed something during checking Java core, but please help me to understand why I cannot use method declared in java main method which is commented</p>

<pre><code>class R {
        public int cal(int a, int b) {
            return a + b;
        }

    public int cal3(int a, int b) {
        return a * b;
    }
}

public class Rect {
    public static void main(String arg[]) {

        /*public static int cal2 ( int a, int b){
            return a + b;
        }

        int ab2 = cal2(2,2);
        System.out.println(ab2);*/
        R r = new R();
        int ab = r.cal(2, 2);
        System.out.println(ab);

        int ab3 =r.cal3(2,3);
        System.out.println(ab3);
    }
}
</code></pre>
