Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Explain the difference between nil and false in ruby?



Explain the difference between nil and false in ruby?..

Answer / Nitin Kumar Verma

In Ruby, 'nil' is an object that represents the absence of any value or object, while 'false' is a boolean value representing falsehood. While 'nil' evaluates to false in boolean contexts, it takes up memory space. On the other hand, 'false' does not consume memory and is preferred for boolean values.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Ruby Interview Questions

Is ruby supports single inheritance/ multiple inheritance or both?

1 Answers  


What is the pattern matching operator in ruby?

1 Answers  


Explain when self.up and self.down method is used?

1 Answers  


How symbol is different from variables?

1 Answers  


In Ruby code, often it is observed that coder uses a short hand form of using an expression like array.map(&:method_name) instead of array.map { |element| element.method_name }. How this trick actually works?

1 Answers  


What are some advantages of using ruby?

1 Answers  


what is a class library in Ruby?

1 Answers  


what is the difference between String and Symbol?

1 Answers  


What are ruby blocks.

1 Answers  


Define ruby methods.

1 Answers  


Tell me what is the command to create a migration?

1 Answers  


What are the operators available in ruby?

1 Answers  


Categories