Q. What is the difference between a class method and an instance method in Ruby?

  • (A) Class methods are called on the class itself, while instance methods are called on instances of the class
  • (B) Instance methods are called on the class itself, while class methods are called on instances of the class
  • (C) Class methods are public, while instance methods are private
  • (D) Instance methods are public, while class methods are private
πŸ’¬ Discuss
βœ… Correct Answer: (A) Class methods are called on the class itself, while instance methods are called on instances of the class

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

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