Life span of variables, JAVA Programming

While you declare a variable in a function, the variable can be accessed within that function only.  While you exit the function, the variable is destroyed.  These variables are called as local variables. You can have local variables along the similar name in distinct functions, because each is identified only by the function wherein it is declared.

If you declare any variable outside a function, all of the functions on your page can access it. The lifetime of these variables begins while they are declared, and ends while the page is closed.

Posted Date: 4/20/2013 1:56:49 AM | Location : United States







Related Discussions:- Life span of variables, Assignment Help, Ask Question on Life span of variables, Get Answer, Expert's Help, Life span of variables Discussions

Write discussion on Life span of variables
Your posts are moderated
Related Questions
In preemptive scheduling, the highest priority task executes until it enters the waiting or dead states or a higher priority task comes into existence. In time slicing, a task i

#question.Write a program to find the area under the curve y = f(x) in java.

Write a JavaScript program to prompt the user for the radius of a sphere and call function sphereVolume to calculate and display the volume of the sphere in the status bar.

Object diagrams define instances instead of classes. They are useful for illustrating some complicated objects in detail about their recursive relationships.     When

I need to write a program to assign values to the variable age and print the reason as major or minor.


Ten pigs were all in a pen, enjoying their morning slop when a bird flew down from a nearby tree and began picking all the best bits out from the trough. This greatly perturbed the

How virtual communities are formed? How these are different from other Communities? Give examples. Virtual Communities are interest-based communities. Members along with genera

Need to develop a Small Android App using Text to speech and Speech to Text feature. Project Description: When the Android App Opens, It will connect to Windows Azure cloud,

Explain what occur when an object is created in Java?