Q. In Ruby, which method is used to define a getter and setter for an instance variable?

  • (A) get_set
  • (B) attr
  • (C) read_write
  • (D) instance
πŸ’¬ Discuss
βœ… Correct Answer: (B) attr

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

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