1
public class Point {
   ...
}

class Line{
    Point location;
    ...
}

So what does this location variable with type Point, exactly do? It doesn't give me an error so I know it's correct, but what is the purpose of it. When I do that, is it the same as doing:

Point location = new Point(); 

Or no? Can I access methods using my location variable I created? Why or why not?

user207421
  • 305,947
  • 44
  • 307
  • 483
VD18421
  • 295
  • 1
  • 5
  • 13
  • Since `Point location;` is class field it is same as `Point location = null;`. See http://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html -> Default Values – Pshemo Oct 27 '15 at 22:28

0 Answers0