Please explain each of the following operators and how and when they should be used: ==, ===, eql?, Equal?



Please explain each of the following operators and how and when they should be used: ==, ===, eql?, ..

Answer / Anjana Yadav

== is the equality operator, it checks if two objects have the same value and the same type. It's commonly used for object comparisons.n=== checks if the left-hand side and right-hand side are equivalent according to a particular classification (such as comparing objects of the same class or instances of the same module).neql? checks whether the left and right operands are exactly equal. It returns true only when both values have the exact same object identity.nEqual? is an alias for eql?

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Ruby Interview Questions

Explain the concepts and capabilities of garbage collection feature of Ruby?

1 Answers  


What is ruby methods?

1 Answers  


Tell us in ruby, it explains about the defined operator?

1 Answers  


How would you freeze an object in ruby?

1 Answers  


What must you do first before you can invoke an unboundmethod object?

1 Answers  


What is the scope of a local variable in ruby?

1 Answers  


What is mvc? And how it works?

1 Answers  


What are the key features of ruby?

1 Answers  


Do you know what is the defined operator?

1 Answers  


What are the ruby variables?

1 Answers  


Explain about ruby code blocks?

1 Answers  


What is ruby software and where and when it is usefull.

1 Answers  


Categories