Prevent a
inherited method from
being
overridden
- You can
disallow
a method to be
overridden
by
the inheritance mechanism
by using the
final
keyword:
public class myClass
{
....
/* ======================================
This method cannot be overridden
====================================== */
public final void method1()
{
// Do something
}
....
}
|
|