final keyword c++ code example Example: final in c++ const int x = 8; x = 10; // Error. x is final variable now