1.

Explain The Difference Between Nil And False In Ruby.

Answer»

The DIFFERENCES of the methods nil and false are:

  • nil cannot be a VALUE, where as a false can be a value.
  • A method RETURNS TRUE or false in case of a predicate, other wise nil is returned.
  • false is a boolean data type, where as nil is not.
  • nil is an object for NilClass, where as false is an object of for FalseClass

The differences of the methods nil and false are:



Discussion

No Comment Found