GeekInterview.com
Home
Tech Articles
Code Samples
Learn
Freelance Projects
Online Testing
Geek Talk
Job Postings
Knowledge Base
Geek Blogs
Question Bank
Interview Questions
Certification
Placement Papers
Tech FAQ
Career Advice
Engineering
Ask Question
I am new,
Sign me up!
User Name
Remember Me?
Password
Interview Questions
Certification
Placement Papers
Tech FAQ
Career Advice
Engineering
Ask Question
GeekInterview.com
>
Interview Questions
>
J2EE
>
Ruby
Go To First
|
Previous Question
|
Next Question
Ruby
| Question 17 of 22
Print
How does nil and false duffer?
Total Answers and Comments:
3
Last Update: May 19, 2009 Asked by:
nancyphilips
Sponsored Links
Best Rated Answer
—
No best answer available. Please pick the good answer available or
submit
your answer.
August 18, 2007 01:07:28
#1
natchiar
RE: How does nil and false duffer?
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.
Is this answer useful?
Yes
|
No
0
2
Overall Rating:
-2
August 18, 2007 05:02:49
#2
Manikandan Mca
RE: How does nil and false duffer?
False is a boolean datatype
Nil is not a data type
Is this answer useful?
Yes
|
No
0
2
Overall Rating:
-2
May 19, 2009 03:13:35
#3
kalyan.allampalli
Member Since: May 2009 Contribution: 2
RE: How does nil and false duffer?
In Ruby nil is an Object for NilClass
You can directly check as nil.class it will return NilClass.
Where as false is an object for FalseClass.
Is this answer useful?
Yes
|
No
Go To Top
Sponsored Links
Related Categories
—
Core Java Interview Questions
EJB Interview Questions
Hibernate Interview Questions
Java Interview Questions
Java Patterns Interview Questions
JDBC Interview Questions
JMS Interview Questions
JSP Interview Questions
Java OOPS Interview Questions
Ruby Interview Questions
Servlets Interview Questions
Spring Interview Questions
Struts Interview Questions
Websphere Interview Questions
Sponsored Links
About Us
-
Privacy Policy
-
Terms and Conditions
-
Contact
-
Ask Question
-
Propose Category
-
Site Updates
Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved