Ruby - Variables and Data Types
What will be the output of the following Ruby code?
sym1 = :apple
sym2 = :apple
puts sym1.object_id == sym2.object_idWhat will be the output of the following Ruby code?
sym1 = :apple
sym2 = :apple
puts sym1.object_id == sym2.object_id:apple symbols point to the same object, so their object_ids are equal, making the comparison true.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions