Ruby - Difference between nil and false in ruby

Explain the difference between nil and false in ruby.

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

Explain the difference between nil and false in ruby.

False is a boolean datatype
Nil is not a data type
20 Python Interview Questions and Answers - Freshers, Experienced
Python interview questions - What is Python? State some programming language features of Python, Explain how python is interpreted, What are the rules for local and global variables in Python?
What is Python? State some programming language features of Python.
What is Python? - Python is a modern powerful interpreted language with objects, modules, threads, exceptions, and automatic memory managements......
Explain how python is interpreted
How python is interpreted - Python program runs directly from the source code. Each type Python programs are executed code is required.......
Post your comment