What is meant byStatic Variable ?
Answers were Sorted based on User's Feedback
A static can only be accessed from the function in which it
was declared, like a local variable. The static variable is
not destroyed on exit from the function, instead its value
is preserved, and becomes available again when the function
is next called. Static variables are declared as local
variables, but the declaration is preceeded by the word
static.
| Is This Answer Correct ? | 7 Yes | 2 No |
static variable or method is not accessable outside the
class where it has been declared.
| Is This Answer Correct ? | 3 Yes | 3 No |
Answer / rutuja gaikwad
static variable is a variable which declared inside class
using keyword static.
its value used only in that class not overall program
example:
#include <stdio.h>
void func() {
static int x = 0; // x is initialized only once
across three calls of func()
printf("%d\n", x); // outputs the value of x
x = x + 1;
}
int main(int argc, char * const argv[]) {
func(); // prints 0
func(); // prints 1
func(); // prints 2
return 0;
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / kanchan
static variables are those which are not change through out
the program and remain constant.
| Is This Answer Correct ? | 1 Yes | 2 No |
Answer / ahmed eldesokey
static variable :
is initialize while loading the programme in the memory and
doesn't destroyed during the running time.
simply it's loaded in the memory during the lifetime of the
program
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / addy
static variable means who's value is constant through out
the program.
| Is This Answer Correct ? | 0 Yes | 6 No |
Hi guyes, I have cleared 2 technical rounds with cts for liferay and java techonologies, i have client round next week, please tell me how to prepare for this what questions i should be ready to face?
1.group by clause explain along with an example
Plz Show notepad Coding using c# in window based application
What are the tasks performed by a Team Lead
What are the Short cut Keys of Tally ERP?
What is meant by spooling
In JCl , we have COND parameter.This holds comparison code and condition.It also has only and even parameters. ex: COND((4,GE),EVEN).what the comma mean here. is that 'and' or 'or'.
Write a pascal program to calculate the sum of the first 100 even number and odd number
Differevce between arrays and array builders?
hi, all this is shoba m.c.a . i have learned abap but no oppurtunities right now as fresher , right now i want to learn any course on demand any one pls suggest me good course and institute in hyderabad
Who is providing best mainframes online training in Hyderabad
the channel in the data communication model can be? option a.postal mail serv. b telephon lines c.radio signals d. all the above
2 Answers iNautix, National Investment Commission,