Dynamic typing and Duck typing

Ruby is a dynamic programming language. Ruby programs are not compiled. All class, module and method definition are built by the code when it run.

Ruby variables are loosely typed language, which means any variable can hold any type of object. When a method is called on an object, Ruby only looks up at the name irrespective of the type of object. This is duck typing. It allows you to make classes that pretend to be other classes.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *