We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
create parent class Arithmetic and child class Adder --> don't specify there modifiers
create constuctor in both classes --> used to create objects
create adder method in Arithmetic or Adder class --> adding two numbers
whats happeing in solution class:
object--> a is being created using Adder class --> Adder a = new Adder(); --> further exaplaition: Adder constructor is to create object a which inherhits constructor from parents class Arithmetic using super()
some methods are being called on to check its parents class (Arithmetic)
Java Inheritance II
You are viewing a single comment's thread. Return to all comments →