From: kendear Date: 2007-09-16T08:56:32+09:00 Subject: if i don't use @n but use n instead, there is no error ------=_Part_3506_29599405.1189900591952 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline in an instance method, if i didn't use @n but used n, the program still runs... and it is not changing the global n... so what is it changing? Example: n = 10 class Foo def initialize(i) @n = i end def change() puts puts "Inside of change!!!!!!!!!!!!!!!!" n = 111111 # intentionally not using @n end def print_it puts p "Printing Object" p @n end end foo = Foo.new(3) foo.print_it foo.change foo.print_it puts p "Global var" p n -------- output ---------------------------------------------------------- C:\rails\depot>ruby test_class01.rb "Printing Object" 3 Inside of change!!!!!!!!!!!!!!!! "Printing Object" 3 "Global var" 10 ------=_Part_3506_29599405.1189900591952--