[this is how i understand overriding, pls correct me if im wrong]
To disallow a class member function to be overriden, which of the following modifiers should be used? A) PUBLIC B) DEFAULT C) PROTECTED D) FINAL E) PRIVATE
the answer is final ; because final by definition means that it cannot be change. like final class cant be extended. in this case, the final method can only be inheritted by the subclas but not overridden.
as for the access modifier private; when you inherit a superclass, the subclass cannot use/see its private variables/method. thus, private method that belongs to a superclass cant be overidden, but a subclass can create a method that has the same name and signature, like the private method, but this is not overidding. [ August 03, 2006: Message edited by: Firman Drage ]
There's a hole in the bucket, dear Liza, dear Liza, a hole in the bucket, dear liza, a tiny ad: