tonyaim83 wrote:
Hi
Java code
Shape s1= obj.getShape();
s1.draw();
Circle c1 = (Circle)obj.getShape();
c1.getRadius();
It's equivalent ruby code
s1 = obj.getShape
s1.draw
c1 = obj.getShape
c1.getRadius
Now here i cannot use the type cast as i have used in java so not able to
invoke the methods of class circle. How to invoke it in ruby.? The code in
bold is giving error.
You should not have to cast anything in Ruby, since we just dispatch to
whatever methods are actually there. If the method is there, you can
call it. Can you show us the error?
- Charlie
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email