1.

The static members are ______________________(a) Created with each new object(b) Created twice in a program(c) Created as many times a class is used(d) Created and initialized only onceThe question was posed to me by my college director while I was bunking the class.This intriguing question comes from Static Member Functions topic in division Exception Handling & Static Class Members of Object Oriented Programming

Answer»

Right option is (d) CREATED and initialized only once

Easiest EXPLANATION - The static MEMBERS are created only once. Then those members are REUSED whenever called or INVOKED. Memory is allocated only once.



Discussion

No Comment Found

Related InterviewSolutions