Kit Ho Kit Ho - 1 year ago 136
Ruby Question

What is the difference between Integer and Fixnum?

I know that the

class inherits from the
class. But what is the actual difference between them? Are there any use cases where we sometimes use
, and sometimes use

Answer Source

You never "use" Integer. It is an abstract class whose job is to endow its children (Fixnum and Bignum) with methods. Under effectively no circumstances will you ever ask for an object's class and be told that it is an Integer.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download