Minggu, 02 April 2017

How scope and life of variables differ in class and globally

Scope of a variable refers to in which areas or sections of a program can the variable be accessed and lifetime of a variable refers to how long the variable stays alive in memory. General convention for a variable’s scope is, it is accessible only within the block in which it is declared. A block begins with a left curly brace { and ends with a right curly brace }. As we know there are three types of variables: 1) instance variables, 2) class variables and 3) local variables, we will look at the scope and lifetime of each of them now.

The post How scope and life of variables differ in class and globally appeared first on Coding Security.


How scope and life of variables differ in class and globally
read more

Tidak ada komentar:

Posting Komentar