Question:
What do you mean by static methods?
Answer:
By using the static method there is no need creating an object of that class to use that method. We can directly call that method on that class. For example, say class A has static function f(), then we can call f() function as A.f(). There is no need of creating an object of class A. Source: CoolInterview.com
Static method is act as something like global method thogh it is class member method since it defines during preprocessing. So, static methods can be called without creating objects.(object.static method is not requred) class::static method can be used to call static methods Source: CoolInterview.com
Answered by: Niranjan Ambati | Date: 4/2/2009
| Contact Niranjan Ambati
The purpose of using static member is to create a copy of the method or a variable per class. not an every object for that class. So static means A copy per Class. Source: CoolInterview.com
Answered by: Siva K | Date: 6/5/2009
| Contact Siva K
static methods are those which exist at compile time.Means the binding of code takes place at compile time so when we have to call this methods there is no need of object as instance method do.. thus static method can be called through class name only.. B.f(); Source: CoolInterview.com
Answered by: Upasana Pardeshi | Date: 9/10/2009
| Contact Upasana Pardeshi
Static methods update the function which is similar to all objects because class calls function.Static function access only static data Source: CoolInterview.com
Answered by: ramesh | Date: 9/25/2009
| Contact ramesh
static members are used for sharing purpose.each object of other classes contains the same copy. Source: CoolInterview.com
Answered by: avnish kumar,miet | Date: 3/19/2010
| Contact avnish kumar,miet
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|