Yeah but there is no equivalent of final keyword in c++.....So to prevent member function from overriding in derived class in c++ dont declare the member function as virtual. Then it cannot be overridden in derived class. There is no other way of preventing a member function of base class from being overridden. *Muthuraj R IV th Year , ISE PESIT , Bangalore*
On Sun, Jul 31, 2011 at 7:38 AM, himanshu kansal < [email protected]> wrote: > i think there is no keyword known as final in c++.....maybe u are talking > with respect to java.... > > > On Sun, Jul 31, 2011 at 8:03 PM, muthu raj <[email protected]> wrote: > >> By declaring the function a static final f()..... >> *Muthuraj R >> IV th Year , ISE >> PESIT , Bangalore* >> >> >> >> On Sun, Jul 31, 2011 at 7:28 AM, himanshu kansal < >> [email protected]> wrote: >> >>> sry i think....i misspelled d ques.... >>> d ques was.... >>> >>> >>> how will you protect a derived class to override base class's member >>> function in c++.... >>> >>> say if there is a function f() in base class then derived should not be >>> able to >>> override f() to provide its own definition..... >>> but The function must be accessible in derived class. >>> >>> >>> PS:dont try to make the function private in base class( it will be >>> become inaccessible in derived class). >>> >>> On Sun, Jul 31, 2011 at 7:49 PM, himanshu kansal < >>> [email protected]> wrote: >>> >>>> how will you protect a base class to override its member function in >>>> derived class.... >>>> >>>> say if there is a function f() in base class then derived cannot >>>> override f() to provide its own definition..... >>>> The function must be accessible in derived class. >>>> >>>> PS:dont try to make the function private in base class( it will be >>>> become inaccessible in derived class). >>> >>> >>> >>> >>> -- >>> >>> Regards >>> Himanshu Kansal >>> Msc Comp. sc. >>> (University of Delhi) >>> >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Algorithm Geeks" group. >>> To post to this group, send email to [email protected]. >>> To unsubscribe from this group, send email to >>> [email protected]. >>> For more options, visit this group at >>> http://groups.google.com/group/algogeeks?hl=en. >>> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > > > -- > > Regards > Himanshu Kansal > Msc Comp. sc. > (University of Delhi) > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
