πŸ“Š Ruby
Q. What is the main difference between instance_eval and class_eval in Ruby?
  • (A) instance_eval evaluates code within the context of a method, while class_eval evaluates code within the context of a block
  • (B) instance_eval evaluates code within the context of a block, while class_eval evaluates code within the context of a method
  • (C) instance_eval evaluates code within the context of an object, while class_eval evaluates code within the context of a class
  • (D) instance_eval evaluates code within the context of a class, while class_eval evaluates code within the context of an object
πŸ’¬ Discuss
βœ… Correct Answer: (C) instance_eval evaluates code within the context of an object, while class_eval evaluates code within the context of a class

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
115
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
82%
Success Rate