What are Java parent and child classes in Java?
Answers
Answered by
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
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
Math,
6 months ago
Computer Science,
6 months ago
English,
6 months ago
Computer Science,
11 months ago
Computer Science,
11 months ago
Math,
1 year ago
Science,
1 year ago