How does nil and false differ?

Questions by nancyphilips   answers by nancyphilips

Showing Answers 1 - 4 of 4 Answers


  • Aug 18th, 2007

The difference of the methods nil and false is shown by executing nil.methods - false.methods and false.methods - nil.methods.

In a Hash, nil cannot be a value, but false can.

It is recommened that a method returns true or false if it is a predicate, and a value or nil otherwise.

A method with suffix ? is usually a predicate, but some built-in functions are not.

Manikandan Mca

  • Aug 18th, 2007

False is a boolean datatype
Nil is not a data type

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.


Related Answered Questions


Related Open Questions