>What is an instance variable?

An instance variable is a variable which is related to a single instance of a class. Each time an instance of a class is created, the system creates one copy of the instance variables related to that class.

An instance variable is delcared inside a class, but not within a method. A variable which is defined inside a class and a method is known as a local variable.

The opposite of an instance variable is a static variable, also referred to as a class variable. A static variable exists across instances of a class.

By default, all variables are created as instance variables.



Top 5 Free Networking Tools

Bookmark What is an Instance Variable?

Latest Blog Posts


English English GermanGerman SpanishSpanish FrenchFrench ItalianItalian PortuguesePortuguese RussianRussian DutchDutch
GreekGreek HindiHindi JapaneseJapanese KoreanKorean ChineseChinese Chinese (Simplified)Chinese (Simplified) ArabicArabic

Copyright 2009 Tech-FAQ. All rights reserved. Privacy Policy.