Question: how inheritance works in java?
Answer: Inheritance in Java. Inheritance is an important pillar of OOP(Object Oriented Programming). It is the mechanism in java by which one class is allow to inherit the features(fields and methods) of another class. ... The subclass can add its own fields and methods in addition to the superclass fields and methods.