Reflecting and counting points on a 2D grid First number indicates the number of points, followed by N points
  (x,y). Then the next number indicates Q num_queries,  followed by Q queries:
  
  
  Reflect all points between point i and j both including along the
  X axis. This query is represented as "X i j" 
  Reflect all points between point i and j both including along the Y axis. This query is
  represented as "Y i j" 
  Count how many points between point i and j both including lie in each of the 4 quadrants. This query is
  represented as "C i j"
  
  
  Sample Input

4         
1 1         
-1 1         
-1 -1
1 -1
5
C 1 4
X 2 4
C 3 4
Y 1 2
C 1 3

  
  Sample Output

1 1 1 1
1 1 0 0
0 2 0 1



How can i improve this code for better metrics?

import java.util.ArrayList;
import java.util.Scanner;

/**
 *
 * @author cypronmaya
 */
class Point {

    int x;
    int y;

    Point(int x, int y) {
        this.x = x;
        this.y = y;
    }
}

public class Quad_query {

    private ArrayList&lt;Point&gt; arrayList;

    public Quad_query(int capacity) {
        this.arrayList = new ArrayList&lt;Point&gt;(capacity);
    }

    public static void main(String args[]) {

        Scanner scanner = new Scanner(System.in);
        int num_of_points = scanner.nextInt();
        Quad_query quad_query = new Quad_query(num_of_points);
        for (int i = num_of_points; --i &gt;= 0;) {
            int x = scanner.nextInt();
            int y = scanner.nextInt();
            quad_query.add(x, y);
        }
        int num_of_queries = scanner.nextInt();
        for (int i = num_of_queries; --i &gt;= 0;) {
            char c = scanner.next().charAt(0);
            quad_query.query(c, scanner.nextInt() - 1, scanner.nextInt() - 1);
        }
    }

    public void add(int x, int y) {
        Point point = new Point(x, y);
        arrayList.add(point);
    }

    public void query(char c, int i, int j) {

        switch (c) {
            case 'C':
                queryC(i, j);
                break;
            default:
                queryXY(c, i, j);
                break;
        }
    }

    public void queryC(int i, int j) {

        int quad_1 = 0, quad_2 = 0, quad_3 = 0, quad_4 = 0;
        for (int k = i; k &lt;= j; k++) {
            Point pnt = arrayList.get(k);
            int pnt_x = pnt.x;
            int pnt_y = pnt.y;
            if (pnt_x &gt; 0 &amp;&amp; pnt_y &gt; 0) {
                quad_1++;
            } else if (pnt_x &lt; 0 &amp;&amp; pnt_y &gt; 0) {
                quad_2++;
            } else if (pnt_x &lt; 0 &amp;&amp; pnt_y &lt; 0) {
                quad_3++;
            } else if (pnt_x &gt; 0 &amp;&amp; pnt_y &lt; 0) {
                quad_4++;
            }
        }
        System.out.println(quad_1 + " " + quad_2 + " " + quad_3 + " " + quad_4);
    }

    private void queryXY(char c, int i, int j) {

        for (int k = i; k &lt;= j; k++) {
            Point pnt = arrayList.get(k);
            int pnt_x = pnt.x;
            int pnt_y = pnt.y;
            if (c == 'X') {
                pnt = new Point(pnt_x, -pnt_y);
            } else if (c == 'Y') {
                pnt = new Point(-pnt_x, pnt_y);
            }
            arrayList.set(k, pnt);
        }
    }
}
Instead of initializing your arrayList when you create the instance of the class, do it when you have the num_of_points value from the scanner.

arrayList = new ArrayList&lt;Point&gt;(num_of_points);


This will mean the array list doesn't need to resize itself (potentially slow operation). In the example you have given with only 4 points it won't make any difference, but if there were a larger number of points you may save some time!

Where you get the value from the scanner char c you trim the value, which you shouldn't need to do as the Scanner should stop when it sees a delimiter (in this case, a space).

In the queryC method, you have a for loop...

for (int b = 0; b &lt; len; b++) {
    pnt = arrayList.get(b);
}


...that does nothing, so you can remove it.

A few notes on code style...


In the main method your for loops go from X down to 0, but in the query methods you go from 0 up to X. Just wondering why?
You also use (0 - pnt.x) where you could use -pnt.x.


Hope this helps.