This week's book giveaway is in the Android forum.
We're giving away four copies of Learning Java by Building Android Games and have Jean-Marcel Belmont on-line!
See this thread for details.
Win a copy of Learning Java by Building Android Games this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

Variables  RSS feed

 
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 ?

 
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!
 
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.
 
Java Cowboy
Sheriff
Posts: 16084
88
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.
 
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)
 
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
Boost this thread!