| |
GeekInterview.com > Interview Questions > J2EE > Core Java
| Print | |
Question: static data member
Answer: what is the use of static data member? |
| August 08, 2008 10:28:21 |
#4 |
| naresh5m |
Member Since: July 2008 Total Comments: 1 |
RE: static data member |
Static Data Member has an intersting feature for the programming languages.
1) While creating functions (2 Reduce the fode redundance) the results of that funcing will have to return to use out side of the function. If cant return that value then we dont have have a change to use the out put of the function. if we store in the static variable then it will be accessed thrught the program.
2) The properties of one class is copied for all the function of the same/another class, no need to reprasent the same thing in no. of time. Just declare it as static then it solves the probelm. |
| |
Back To Question | |