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.

-- 
View this message in context: 
http://www.nabble.com/How-to-cast-object-in-ruby-tp22802352p22802352.html
Sent from the JRuby - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to