Top "Class-variables" questions

A class variable is a variable shared by all instance of that class.

Are static class variables possible in Python?

Is it possible to have static class variables or methods in Python? What syntax is required to do this?

python class oop static class-variables
What is the difference between up-casting and down-casting with respect to class variable

What is the difference between up-casting and down-casting with respect to class variable? For example in the following program class …

java casting class-variables downcast upcasting
Ruby class instance variable vs. class variable

I read "https://stackoverflow.com/questions/826734/when-do-ruby-instance-variables-get-set" but I'm of two minds when to use class instance variables. Class variables …

ruby instance-variables class-variables class-instance-variables
What does @@variable mean in Ruby?

What are Ruby variables preceded with double at signs (@@)? My understanding of a variable preceded with an at sign is …

ruby syntax instance-variables class-variables
Create module variables in Ruby

Is there any way to create a variable in a module in Ruby that would behave similar to a class …

ruby module class-variables
Java: Getting the properties of a class to construct a string representation

Let's say I have a class like this (and also further assume that all the private variables: public class Item { …

java reflection class tostring class-variables
why are java constants declared static?

Why are java constants declared static ? class Foo{ static final int FII = 2 ; } In this I understand the use of final? …

java static constants final class-variables
python subclass access to class variable of parent

I was surprised to to learn that a class variable of a subclass can't access a class variable of the …

python subclass class-variables
Ruby class variables

The ruby class-instance stuff is giving me a headache. I understand given this... class Foo @var = 'bar' end ...that @var …

ruby class inheritance class-variables
How can Ruby's attr_accessor produce class variables or class instance variables instead of instance variables?

If I have a class with an attr_accessor, it defaults to creating an instance variable along with the corresponding …

ruby instance-variables class-variables class-instance-variables