== and equal" are different : equal « Class « Ruby
- Ruby
- Class
- equal
== and equal" are different
a = "Ruby" # One String object
b = "Ruby" # A different String object with the same content
a.equal?(b) # false: a and b do not refer to the same object
a == b # true: but these two distinct objects have equal values
Related examples in the same category