Originally posted by Dinesh Tahiliani: I think we are accessing the inner class outside outer class. Correct me if iam wrong..
you aren't accessing inner class(Point) outside outer class(Line) as main method is a part of the Line class. you need an instance of class Point to access the getPoint() method, so l.getPoint() won't do since l is not an instance of Point. you can try
new Line().new Point().getPoint()
Line l=new Line(); Line.Point p=l.new Point(); p.getPoint();