From: Li Chen Date: 2006-12-18T04:59:07+09:00 Subject: Re: with and without initialize method > Try the program with this line: > > X.new > > removed or commented out. You'll get the same output. The reason is > that the statement: > > puts "x" > > is executed when the class definition is executed. puts "y", however, > is inside an instance method (initialize), so it isn't executed until > there's an instance (and in this case, since it's an > automatically-called constructor, you don't have to call it > explicitly). Thanks David. Now I get the point. Li -- Posted via http://www.ruby-forum.com/.