• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Variables

 
jose chiramal
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IS there any difference between class variables and static variables , local variables and automatic variabes ?

 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jose chiramal wrote:IS there any difference between class variables and static variables , local variables and automatic variabes ?



How about letting us know your thoughts first after you've reviewed Google and tutorials. So, what do you think?

Best of luck!
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Automatic variables ?
 
jose chiramal
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Automatic variables are also known as local variables ( http://en.wikipedia.org/wiki/Automatic_variable)


Class variable and static variables are the same.

Please correct me incase am wrong.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15495
43
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The term "automatic variable" comes from C and C++ and is not commonly used in Java.

Sun's tutorial about variables tells you everything about different kinds of variables.
 
sai prashanth
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See if this helps:

1. Instance Variables (A variable defined in a class and could be visible outside the scope of the class too- also called Class variable, can be static, final, private, public transient, volatile)
2. Local variables (When the scope of the variable is limited to a method and is not available outside, only possible access modifier is final)
 
Lee Eun-Soo
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jose chiramal wrote:IS there any difference between class variables and static variables , local variables and automatic variabes ?



well,in my opinion,class variable need to home like new classname(); keyword(?). but static variables can be accessed by using classname like classname.variablename;

sorry for my poor english abilty hAHA
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic