Question #63981

how would you prevent a class from being used as a base class?

Expert's answer

Solution

public final class someClass{

}


Answer

If you make any class as final, you cannot extend it. That’s why you should use Java keyword “final” if you want prevent a class from being used as a base class.

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS