1.

What is the keyword used to make data members have same value?(a) static(b) const(c) double(d) abstractThe question was asked in an international level competition.Enquiry is from Data Members topic in portion Class Members & Types of Object Oriented Programming

Answer»

Right OPTION is (b) const

Easy explanation - The keyword const can be used ANYWHERE to make the VARIABLE have same value all the time. This restriction is made to use the same value whenever required. Also, this can restrict accidental changes.



Discussion

No Comment Found

Related InterviewSolutions