What is the use of static functions?

Answer Posted / anh vu

A static function member can be used to provide utility
functions to a class. For example, with a class representing
calendar dates, a function that tells whether a given year
is a leap year might best be represented as a static
function (DateTime.IsLeapYear). The function is related to
the operation of the class but doesn't operate on particular
object instances (actual calendar dates) of the class.

Is This Answer Correct ?    15 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write about the role of c++ in the tradeoff of safety vs. Usability?

785


Distinguish between a # include and #define.

841


Explain rtti.

774


In inline " expression passed as argument are evalauated once " while in macro "in some cases expression passed as argument are evaluated more than once " --> i am not getting it plz help to make me understand....

2167


What's c++ used for?

815






what is data encapsulation in C++?

774


What is the difference between structures and unions?

777


Which c++ compiler is best?

813


What is array in c++ pdf?

763


Mention the ways in which parameterized can be invoked.

705


Is c++ free?

790


Explain overriding.

757


the first character in the variable name must be an a) special symbol b) number c) alphabet

815


What is the header file for setw?

791


Is map thread safe c++?

839