Ruby - Class Methods and Variables
What is the main difference between
dup and clone in Ruby?dup and clone in Ruby?dup copiesdup creates a shallow copy but does not copy frozen state or singleton methods.clone copiesclone copies everything including frozen state and singleton methods.clone copies frozen state and singleton methods; dup does not. -> Option A15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions