• 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
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

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
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
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!