consider this inheritance of MyVector from MyPoint:
Code:
class MyPoint { /* ... */ public MyPoint add(MyPoint other){ ... } } class MyVector extends MyPoint { /* ... */ } /* somewhere in the code */ MyVector v1 = new MyVector(...); MyVector v2 = new MyVector(...); MyVector v3 = v1.add(v2); // Error, cannot cast from