System.out.println("line 1:[("+getX1()+","+getY1()+")->("+getX2()+","+getY2()+")]"); implies you're trying to use static methods called getX1()... which belong to the class LineSegmentTester....