title: How to return a list from a method in Java
body: <p>So i need to get this "points" list in other class, but i actually cant get it anyhow. I know, maybe answer is obvious, but im really stuck here.</p>
  
  <pre><code>public List&lt;Point&gt; setDots(ArrayList&lt;Integer&gt; list) {
      Point point1 = new Point(list.get(0), list.get(1));
      Point point2 = new Point(list.get(2), list.get(3));
      Point point3 = new Point(list.get(4), list.get(5));
      Point point4 = new Point(list.get(6), list.get(7));
      List&lt;Point&gt; points = new ArrayList&lt;&gt;();
      points.add(point1);
      points.add(point2);
      points.add(point3);
      points.add(point4);
      return points;
  }
  </code></pre>
  
  <p>and here is the class where i need to call it</p>
  
  <pre><code>public static void main(String[] args) throws IOException {
      BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
  
      Point userPoint = new Point(Integer.parseInt(reader.readLine()), Integer.parseInt(reader.readLine()));
  
      DotsReader dr = new DotsReader();
      dr.pointReader();
  
      DotsSetter ds = new DotsSetter();
      ds.setDots(dr.dots);
  }
  </code></pre>
  
  <p>i need to compare if userPoint lie on the edge or in or out of the my square. Cant resolve it with my experience.
  Got no errors, but cant find a way to catch returned "points" in main method.
  Help me here please.</p>