Computer Science, asked by Umapathi9944, 8 days ago

What are two methods to restrict a class from being inherited in java??

Answers

Answered by harshsinghrawat2007
0

Explanation:

There are 2 ways to stop or prevent inheritance in Java programming. By using final keyword with a class or by using a private constructor in a class.

Answered by xXItzVillainxX
3

Answer:

  • There are 2 ways to stop or prevent inheritance in Java programming. By using final keyword with a class or by using a private constructor in a class
Similar questions