Difference between local,global,instance variable?



Vikas Said

+0 -0

Local Variable
Local Variable are the variable that declare inside a function or block and the access of that variable is within a function or block.
Static Variable
Static Variable are the variable that declare inside a class and outside the method and we can easily access by their class name.
Instance Variable
Instance Variable are the variable which is unique for every objects.Instance variable are mainly declare with self keyword.We can easily access using object.



Submit Your Response