Why static functions always uses static variables?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
Petrol pump mgt. system: To design a program that display an interface for the sale of the Petrol and then make the entries at the backend in the database.
What is the main feature of oop?
I hv a same function name,arguments in both base class and dervied class, but the return type is different. Can we call this as a function overloading? Explain?
Tell me the scenario,Where we can use interfaces or Abstract class.And What is the difference between interfaces and abstract class?
Given two strings like x=?hello? and y=?open?, remove any character from string x which is also used in string y, thus making the result x=?hll?.
What is abstrac class?where is it use?
Why do we use polymorphism in oops?
define a string class. overload the operator == to compare two strings
2 Answers Birla, Ericsson, HCL, Infosys, Infotech, MCAS, Satyam,
what type of questions
What language is oop?
How to hide the base class functionality in Inheritance?
WAP find square root of any number (without using sqrt() )?