If u really dont want to inherit a class,then just make its member variables and member functions as private ,if other class tries to inherit it they cant have access to its funtions and variables anyways.
But using final is a better option
1
solved Is there any way to restrict inheritance? [closed]