title: indexOf() will not find a custom object type
body: <p>The following code does not give me right answer.</p>
  
  <pre><code>class Point {
  
      int x; int y;
      public Point(int a,int b){
          this.x=a;this.y=b;
      }
  }
  
  class A{
  
      public static void main(String[] args){
  
          ArrayList&lt;Point&gt; p=new ArrayList&lt;Point&gt;();
          p.add(new Point(3,4));
          p.add(new Point(1,2));
          System.out.println(p.indexOf(1,2));
  
      }
  }
  </code></pre>
  
  <p>This gives <code>-1</code>;</p>
  
  <p>In general if arraylist of point is given, how can we find index of a particular point in in array ?</p>