For C Programming, the use of a static variable has two uses:
One reason is to hide the variable from other modules. The scope of the static variable is limited to the compilation unit that it is described in.
The second use of a static variable is to keep the value of the variable intact through the entire program execution unit.
it depend on the programming language u use. for instance in c, just decalre the variable and equal it to the value it is to take. eg. my_age=21; /*my_age is the decared variable and 21 is the assigned value*/ //for php $my_age=21; /*my_age is the decared variable and 21 is the assigned value*/ for strings (in php)eg. $my_age="none of ur business" /*$my_age is the variable and the string "none of ur business" is the assigned value*/
"A class containing a static variable that stores a unique, and inaccesibleto external classes (private), intance of itself. The static variable isaccessed by a static method, with public access, usually called getIntance.The static variable is initiated by the static getInstance method thatvalidates wether or not the static variable already exits. If the staticvariable has not being initiated, a new instance of the class is createdand assigned to the static variable which reference is then returned by themethod. If the static variable was previously created, the method willreturn a reference to the static variable." 1A Singleton class is used when you wish to restrict instantiation of a class to only one object."Simple Singleton Pattern Example in AS3class Data{private static var dataInstance:Data;public static function getInstance():Data{if(!dataInstance) dataInstance = new Data();return dataInstance;}public function Data(){if(dataInstance) throw Error("instance exists, please use Data.getInstance()");}}" 21 [Daniel Guzman - AS3 Object Oriented Programming]2 [Daniel Guzman - AS3 Object Oriented Programming]
static reference type
c++
Java
it depend on the programming language u use. for instance in c, just decalre the variable and equal it to the value it is to take. eg. my_age=21; /*my_age is the decared variable and 21 is the assigned value*/ //for php $my_age=21; /*my_age is the decared variable and 21 is the assigned value*/ for strings (in php)eg. $my_age="none of ur business" /*$my_age is the variable and the string "none of ur business" is the assigned value*/
Use the "static" keyword to declare a static variable within a function like shown below. <?php function fun() { static $variable; static $another_variable = ''; } ?>
"A class containing a static variable that stores a unique, and inaccesibleto external classes (private), intance of itself. The static variable isaccessed by a static method, with public access, usually called getIntance.The static variable is initiated by the static getInstance method thatvalidates wether or not the static variable already exits. If the staticvariable has not being initiated, a new instance of the class is createdand assigned to the static variable which reference is then returned by themethod. If the static variable was previously created, the method willreturn a reference to the static variable." 1A Singleton class is used when you wish to restrict instantiation of a class to only one object."Simple Singleton Pattern Example in AS3class Data{private static var dataInstance:Data;public static function getInstance():Data{if(!dataInstance) dataInstance = new Data();return dataInstance;}public function Data(){if(dataInstance) throw Error("instance exists, please use Data.getInstance()");}}" 21 [Daniel Guzman - AS3 Object Oriented Programming]2 [Daniel Guzman - AS3 Object Oriented Programming]
No. In order to make or use a program or a programming language, you need to know a programming language.
"A class containing a static variable that stores a unique, and inaccesibleto external classes (private), intance of itself. The static variable isaccessed by a static method, with public access, usually called getIntance.The static variable is initiated by the static getInstance method thatvalidates wether or not the static variable already exits. If the staticvariable has not being initiated, a new instance of the class is createdand assigned to the static variable which reference is then returned by themethod. If the static variable was previously created, the method willreturn a reference to the static variable." 1A Singleton class is used when you wish to restrict instantiation of a class to only one object."Simple Singleton Pattern Example in AS3class Data{private static var dataInstance:Data;public static function getInstance():Data{if(!dataInstance) dataInstance = new Data();return dataInstance;}public function Data(){if(dataInstance) throw Error("instance exists, please use Data.getInstance()");}}" 21 [Daniel Guzman - AS3 Object Oriented Programming]2 [Daniel Guzman - AS3 Object Oriented Programming]
static: we can use the keyword static either to method or to a variable. when we declare to a method,(eg: public static void main(String args[]),we can use this method without any object. when we use to a variable,there will be only one instance of that variable irrespective of how many objects that get created of that class. Final: Usage of final to method or to a variable makes them as constant. It's value cannot be changed...
Your question makes no sense.
static reference type
No, it is a programming language.
In computer-programming.
Programming, mainly.
For is it programming used.