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 the difference between rename and label

0 Answers   Satyam,


Compare any 4 software development life cycle paradigms with each other. Indicate at least one application for each of the paradigms that are suitable to developed using that paradigm.

0 Answers  


Tell me the jobs for the MCA Fresher in delhi, Noida..

0 Answers  


hii I inntrested abt scjp certification but i dont knw abt scjp plz send details abt scjp exam and syllabus.

0 Answers  


i want to insert textbox value to sql db. i have only one text box but store four values. ple give any one give sample code in asp.net c#..

1 Answers   Concentrix,






how to hide prompts

0 Answers  


there are N number of matchboxes numbered 1...N.each matchbox contain various number of stick.Two player can alternatevely pick some amount of stick from the higest stick containing box . The player is condidered win if there is no stick after his move.Find the final move so that the move player win. Note:In case the number of stick is equal ,pick the stick from the higest numbered box. eg: 3 box contain stick as:1,1,1. if u take 1 stick from 3rd numbred box you will any how win the match.

0 Answers   Manhattan,


how can we get version of database ?

1 Answers  


Difference between interface and abstract class?

2 Answers   Cognizant, CTC,


Write a pseudo code to evaluate a number to any base given (2...16) based on the input. Number greater than 9 should be given as A-F for 10-15.

0 Answers   Goldman Sachs,


how sap is different from other software ?

0 Answers  


Difference between debugging, running, executing of an application

0 Answers   HCL,


Categories