Why static functions always uses static variables?

Answers were Sorted based on User's Feedback



Why static functions always uses static variables?..

Answer / george from psg

static function is constant to all object. In the same way
static variable is constant to all so we use static variable
in static function

Is This Answer Correct ?    9 Yes 1 No

Why static functions always uses static variables?..

Answer / som shekhar

If you take in the context of the class, static member
functions cannot be called by the ordinary objects because
when normal object calls the function then address of the
object is passed is collected by "this" pointer and static
member function don't have "this" pointer.

Is This Answer Correct ?    0 Yes 0 No

Why static functions always uses static variables?..

Answer / harsha

context,object are created in RAM. context is created
once.static methods implementaion , static varibles loads
into context only once.All those staic members avilable to
each other obviously.

Is This Answer Correct ?    2 Yes 3 No

Post New Answer

More OOPS Interview Questions

explain defference between structure and class with example

1 Answers  


What is the expansion of OOPS?

24 Answers   TCS,


What are the features of oop?

0 Answers  


Explain the concepts involved in Object Oriented programming.

0 Answers   Wipro,


what is the difference between function template and template of function?explain with example.

2 Answers  


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.

0 Answers  


what is the need of abstraction? what is abstraction?what is the abstraction for stack?

8 Answers   CTS, Verizon,


When not to use object oriented programming?

0 Answers  


What is the main difference between C++ and Java

11 Answers   TCS,


what is the difference between javap and jad utility

1 Answers   Wipro,


What is polymorphism ? Explain with examples

8 Answers   Ness Technologies,


What is overriding in oop?

0 Answers  


Categories