Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren+ 7
How can we restrict inheritance for a class?
2 Antworten
+ 7
We can prevent inheritance with keyword final.
For example:
public final class Person {
}
+ 4
Private data and methods can't be seen in subclasses.