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

if 3 duplicate records, by keeping one original and one duplicate record, and how to delete remaining 2 duplicates in sql server 2008

0 Answers  


Number of null pointers in any binary tree

5 Answers   Infosys,


Given three sides of a triangle. Write the Program to determine whether the triangle is : 1) Invalid 2) Right Angled 3) Isoscales 4) Equilateral 5) Not Special An Isoscales right angled triangle should be taken as a Right Angled Triangle

3 Answers   FFC, Goldman Sachs, Student,


What function would you use to extract characters from a given string?

2 Answers  


what are methods we have in connection pooling

1 Answers   Wipro,






Diff.b/w Frames and container?

1 Answers   Tech Mahindra, Wipro,


is possible to delete specific data in a row by using of sql query?

0 Answers   HCL,


What are the other ways to create an object with out calling new keyword in java?

2 Answers   HCL,


Please forward important interview and basic questions in VB6 on my email id: usneha_16@yahoo.co.in

0 Answers  


What is the Super Class of Exception in java?

11 Answers   Andesa Services, Benchmark, CitiGroup, CMC, Evergent, KOT Systems, Value Labs, Vijay infoart Solutions,


what is different betweet class and interface in java?

2 Answers   Microsoft, Sun Microsystems,


How to swap values between two variables without using a third variable?

24 Answers   HCL, TCS,


Categories