Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Polymorphism & Introductions

Hi,
 
Consider the following simple program:
 
public class Shape {
 void draw() {
  System.out.println("Shape.draw() called");
 }
}
 
public class Line extends Shape { 
}
 
public aspect AnAspect {
 void Line.draw() {
  System.out.println("Line.draw() called");
 }
}
 
public class Main {
 public static void main(String[] args) {
  Shape s = new Line();
  s.draw();
 }
}
 
The AJDT 1.1.12 for Eclipse 3.0.0 generates following output for the above program:
 
Shape.draw() called
 
I want to know why polymorphism does not work here?
 
Thanks and Regards,
Aamir Raheem,
FAST-NU,
Pakistan.


Express yourself instantly with MSN Messenger! MSN Messenger Download today it's FREE!

Back to the top