what is a ststic variable and stiticfunction
briefly explain with exmple and in which case we use
Answers were Sorted based on User's Feedback
Answer / subhashish sen
When a variable is declared with static keyword,its called
as static variable,means it retains its value across
different function calls.Its basically used for counting no
of objects created for a class in C++ and its initialized to
0 by default.
When a function declared as static,its called as static
function.It can only operate on static variables.
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / zubeir
Static variable is the one allocated statically, meaning
that, it is allocated once in the program space and exists
till the program space is deallocated (the close of the
application).
Note:- Some people get confused between stack allocation
and static allocaion. Both are different terms.
A static function is again the same concept with static
variable allocation, but here the allocation is not just a
variable but a function's 'activation frame'. The
activation frame, for now, consider the function's
information required by the compiler to execute the
function which is stored internally.
| Is This Answer Correct ? | 1 Yes | 5 No |
What is Difference Between Inheritance and creating object and getting data? means Class A extends B{ B.getMethod();} (OR) Class A{ b obj=new B(); obj.getMethod(); }
Write a program to find out the number of palindromes in a sentence.
what is opps?why it is use in programming language?
Hi friends I have experience of 6 months in website design and maintanence. Now i am looking for other IT jobs.. to switch platform. please post any interview you know in chennai.
What are objects in oop?
When is a memory allocated to a class?
Are polymorphisms mutations?
how to create thread in java?
17 Answers IBM, Infosys, Wipro,
How to deploy web appliction in web logic ?
What is Method overloading?
i^=j; j^=i; i^=j; value of i,j
Describe the difference between a Thread and a Process?