What is meant byStatic Variable ?

Answers were Sorted based on User's Feedback



What is meant byStatic Variable ?..

Answer / swetcha

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

What is meant byStatic Variable ?..

Answer / mahendra giri

static variable or method is not accessable outside the
class where it has been declared.

Is This Answer Correct ?    3 Yes 3 No

What is meant byStatic Variable ?..

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

What is meant byStatic Variable ?..

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

What is meant byStatic Variable ?..

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

What is meant byStatic Variable ?..

Answer / manikandan

more difference b/w xp& win98

Is This Answer Correct ?    0 Yes 2 No

What is meant byStatic Variable ?..

Answer / addy

static variable means who's value is constant through out
the program.

Is This Answer Correct ?    0 Yes 6 No

Post New Answer

More Programming Languages AllOther Interview Questions

what is oops?

4 Answers   Satyam,


What is Partial class and its use?

1 Answers  


What is the difference between in-proc and out-of-proc?

2 Answers   Oracle,


Bonjour, svp je veut voir comment envoyer un mail en java et comment changer le droit d'accé d'un fichier en java: de lecture en lecture/écriture et merci d'avance ;)

0 Answers  


write a query that returns one row for each department and the number of employees in that department. Given two tables EMPLOYEE and DEPARTMENT, where there can be multiple employees per department.

0 Answers   IBM,


1. Write a program to create a sentence at runtime and count number of vowels in it ? 2. Write a program to get a string and to convert the 1st letter of it to uppercase ?

0 Answers   HTC,


What is the client concept in SAP? What is the meaning of client independent?

3 Answers  


How to know we are in home page of a web application using QTP

0 Answers   HCL,


What is the difference between save and create method of activerecord?

0 Answers  


What Is The Difeerence Between C & C++

2 Answers   HCL,


what is dot net framework

0 Answers   NIC,


Hi can you please help for the following. I have a ASP.Net web page I want to print the whole page how is it possible? I want It in ASP also.Please send me the solutions dipankar.hazari@gmail.com . Thanks in advance.

0 Answers   Philips,


Categories