FANDOM


Variables

Primitive data types give context to variables.

A variable refers to the memory location that holds values like numbers, texts etc. in the computer memory. A variable is the name of a location where the data is stored when a program executes.

Java defines four (4) kinds of variables:[1]

Instance VariablesEdit

In object oriented programming, objects store their individual states in the "non-static fields" that is declared without the static keyword. Each object of the class has its own set of values for these non-static variables so we can say that these are related to objects (instances of the class).Hence these variables are also known as instance variables. These variables take default values if not initialized.

Class Variables Edit

Local Variables Edit

Parameters Edit

External sites Edit

ReferencesEdit

  1. Oracle. "The Java Tutorials - Language Basics: Variables". 2014. Accessed 2014-10-23 15:01:37 UTC.

WikipediaEdit

  1. Wikipedia contributors, "Instance variable," Wikipedia, The Free Encyclopedia, http://en.wikipedia.org/w/index.php?title=Instance_variable&oldid=630813009 (accessed October 23, 2014).
  2. Wikipedia contributors, "Class variable," Wikipedia, The Free Encyclopedia,http://en.wikipedia.org/w/index.php?title=Class_variable&oldid=622007191 (accessed October 23, 2014).
  3. Wikipedia contributors, "Local variable," Wikipedia, The Free Encyclopedia,http://en.wikipedia.org/w/index.php?title=Local_variable&oldid=602540572 (accessed October 23, 2014).
  4. Wikipedia contributors, "Parameter (computer programming)," Wikipedia, The Free Encyclopedia, http://en.wikipedia.org/w/index.php?title=Parameter_(computer_programming)&oldid=629664021 (accessed October 23, 2014).

WikibooksEdit

  1. Wikibooks contributors, "Java Programming/Variables," Wikibooks, The Free Textbook Project, http://en.wikibooks.org/w/index.php?title=Java_Programming/Variables&oldid=2704308 (accessed October 23, 2014).

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.