class User
# attr_accessor :name
# attr_writer :name
attr_reader :name
def initialize(name, score)
@name = name
@score = score
end
# # getter
# def name
# @name
# end
# # setter
# def name=(new_name)
# @name = new_name
# end
def get_info
"Name: #{@name}, Score: #{@score}"
end
end
user1 = User.new("Taro", 70)
user2 = User.new("Jiro", 90)
user1.name = "TARO"
puts user1.name