Is it possible to restrict Inheritance in Java?

Random Post | #AskTheCode

Yes, it is. You can restrict Inheritance by:

a. Using the final keyword.

b. Making the method final.

c. Using private constructor.

d. Using (//) Javadoc comment.


7 views

Recent Posts

See All

"Believe you can and you're halfway there"