From: Philip Mak Date: 2002-08-12T01:48:03+09:00 Subject: subclassing and @@variable I have the following test code: class XSuperClass #@@data = "This is the super class." def callme puts @@data end end class XSubClass < XSuperClass @@data = "This is the sub class." end x = XSubClass.new x.callme If I un-comment out the second line and run it, I get this: This is the sub class. If I comment out the second line and run it, I get this: supersub.rb:5:in `callme': uninitialized class variable @@data in XSuperClass (NameError) Why is the presence of the second line important? The value that it sets seems to be irrelevant.