Every object have limitation of access, so any object which created inside of opening and closing brackets {} than its accessibility is limited, so it's known as local object, but object declared outside of methods (in class) then it's become common for all methods so it's known as a global object.
local gffg
What are the differences between local and global?Ans:Variables are declared inside a function is called local variables and Variables are declared outside any function is called global variable
basic diff is in local: Variables are declared inside a function. in global:Variables are declared outside a function.
Global variables are program level,i.e their scope and visibility is througout the program while as locals are restricted within the function they are defined and they r destroyed when the execution fof that function ends
local
.
the local variable cant be used by the other function of the program as its usage is limited upto that function in which it is declared.On the other side the global variable can be used anywhere in the program as its usage is not limited to a particular function.
What can i take-up there,sir !!! Local___ and Global___?
''