Computer Science, asked by Priyam7233, 11 months ago

What are Java parent and child classes in Java?

Answers

Answered by taibak32
3

Answer

When a Class extends another class it inherits all non-private members including fields and methods. Inheritance in Java can be best understood in terms of Parent and Child relationship, also known as Super class(Parent) and Sub class(child) in Java language.

Answered by StaceeLichtenstein
1

Following are the explanation of java parent and child classes in Java is given below .

Explanation:

  • When a class inherits all the properties like method and function of its superclass is known as child class However the superclass is called java parent class.
  • The process of describing a new class from an old class called inheritance. The new class is child class and old class is parent class  
  • We used the extends keywords for inheriting the superclass into the child class.
  •      class abc1 extends test

          {

            // properties and method  

          }

here abc1 is child class and test is parent class

Learn More:

https://brainly.in/question/13581077

Similar questions