Content deleted Content added
added a link |
m →final in Java: dbl the |
||
Line 147:
i = 4; // Error! Cannot modify a "final" object
It must be decidable by the compilers where
It is interesting to note that whereas Java's <code>final</code> and C++'s <code>const</code> keywords have the same meaning when applied with primitive variables, their meanings diverge when applied to method definitions. Java cannot simulate C++'s <code>const</code> methods. Similarly, C++ does not have any feature equivalent to Java's <code>final</code> modifier for methods, although its effect on classes can be simulated by a clever abuse of the C++ <code>friend</code> keyword.{{ref|cleverabuse}}
|