Talk:Class variable

Shared across instances
not sure where i'm supposed to put this, top or bottom, but this is an incorrect definition. in many oop languages, including c# and java, a class member variable or (class variable) for short is instance agnostic. e.g. it can either be a static or an instance variable. can someone fix this? -bc —Preceding unsigned comment added by 64.125.183.186 (talk) 18:53, 25 June 2010 (UTC)


 * fuck it. i fixed it. vera, your definition here is incorrect. - bc —Preceding unsigned comment added by 76.95.140.83 (talk) 20:50, 3 July 2010 (UTC)


 * Actually, class variable values are by definition shared by all instances of a class, and instance variables can never be class variables. See for an explanation of this for Java and  for a Python one. Even Objective C, which does not have a dedicated class variable syntax, recognizes the concept of class variables as distinct from instance variables in its runtime reference at . I will edit the article to remove any confusion about this and add citations. Links to references for other object-oriented languages' use of the "class variable" term would be very welcome, particularly links to C# and C++ references. -cph --173.226.146.65 (talk) 18:49, 21 October 2010 (UTC)

2003 edits
Vera Cruz, please hold your horses on these multiple edits within a short time span. This is neither the correct name for this article nor the correct definition.

The correct name is class data member and in the the definition it should be made clear that when you say all instances share the member that we are not talking about static members, and indicate that static members have one instance across all instances of the class. Mintguy — Preceding undated comment added 16:20, 16 January 2003


 * I see what you're doing now. But I think class variable is the Java name for the term, static data member is the C++ name for the term. I'm not sure what the correct OOP name is. Mintguy — Preceding undated comment added 16:26, 16 January 2003


 * Im going to go play chess now. You should use my talk page as Im likely to miss talk on wiki pages. You should also request that wikipedia install a bbs and chatrooms Vera Cruz — Preceding undated comment added 16:29, 16 January 2003

"Static field" listed at Redirects for discussion
A discussion is taking place to address the redirect Static field. The discussion will occur at Redirects for discussion/Log/2021 June 17 until a consensus is reached, and readers of this page are welcome to contribute to the discussion.  - Jay (Talk) 07:16, 18 June 2021 (UTC)