Top "Instance-variables" questions

In object-oriented programming with classes, an instance variable is a variable defined in a class (i.e. a member variable), for which each object of the class has a separate copy.

class variables is shared across all instances in python?

I started coding in python a week ago, it is my mistake i started coding using oops,classes and objects …

python class global-variables instance-variables member
Instance variable: self vs @

Here is some code: class Person def initialize(age) @age = age end def age @age end def age_difference_with(…

ruby self instance-variables
Instance Variables in Javascript Classes

I mostly code in PHP and Java, but I will occasionally work on the front end of a project and …

javascript class oop constructor instance-variables
Using Instance Variables in Class Methods - Ruby

I have a class something like below, and I used instance variables (array) to avoid using lots of method parameters. …

ruby instance-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
Java instance variables vs. local variables

I'm in my first programming class in high school. We're doing our end of the first semester project. This project …

java variables instance-variables
How to pass a default argument value of an instance member to a method?

I want to pass a default argument to an instance method using the value of an attribute of the instance: …

python instance-variables default-arguments
What is the difference between an instance and a class (static) variable in Java

The title of this question is actually a previous examination question and I am looking for clarification / an answer to …

java static instance-variables class-variables
Private members in CoffeeScript?

Does somebody know how to make private, non-static members in CoffeeScript? Currently I'm doing this, which just uses a public …

oop instance-variables private-members coffeescript
Do declared properties require a corresponding instance variable?

Do properties in Objective-C 2.0 require a corresponding instance variable to be declared? For example, I'm used to doing something like …

objective-c instance-variables declared-property