Total members 10261 | Gratitudes |It is currently Wed May 23, 2012 9:12 am Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 1 post ] 
Author Question
 Question subject: Local variables vs Instance variables
PostPosted: Thu Jan 29, 2009 4:05 pm 
Offline
Mastermind
User avatar

Joined: Tue Mar 27, 2007 10:55 pm
Posts: 2279
Location: Earth
Has thanked: 39 time
Have thanks: 61 time

Local variables vs Instance variables
Here i compare between two terms in Java Local variables and instance variables .

Local variables : Are the variables declared inside the function. Their scope is limited to the function .They can be only accessed inside the function. They are deleted at the end of method.Local variables are called stack variables because they are saved in the stack.

Instance variables: All the variables created in the class and not inside a function .Their scope is the scope of the class instance and they are saved in the heap .


you may need to know that there is a variables named " static variables , these variables is declared using the static modifier ,and their scope is the scope of the class it self. static variables can be accessed from static or non-static variables .

_________________
Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )


TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 1 post ] 
Quick reply


  

 Similar topics
 Local Web designers
 use local user dll from website - usar dll local del usuario
 PHP session variables problem in Firefox
 PHP session variables problem in Firefox
 pass parameters to main method args[] variables
 Static Methods and Variables
 VB/Oracle Developer-Must be local to Minnesota
 dynamic array as global variables
 different between Local variable and Global variable
 Dynamically Setting and Accessing Variables

All times are UTC [ DST ]


Users browsing similar posts

Users browsing this forum: No registered users and 1 guest



Jump to:  
Previous Question | Next Question 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team