Tag: static variable
-
static and non-static variable
static variable: If you declare any variable as static, it is known as a static variable. Advantages of static variable: It makes your program memory efficient (i.e., it saves memory). Non -static variable: A non-static variable is initialized every time a new instance of its class is created, and as such there can be multiple copies of…