Using Inheritance Oops concept where one class can acquire the property of another class. There is given
a Dog class with one property
name
and class Greyhound which is a breed of dog. Greyhound inherit the property of Dog class and have some
another property called
color
weight
you have to complete the commented field in Dog class and Greyhound class
i.e Dog class
class Dog {
private String name;
-
-
-
1
-
-
1
1.
-
-
-
-
-
-
-
1
1
1
1
1
1
1
--
-
-
-
-
-
-
-
-
1
1
1
Il create parametrize constructor to initialize the all field i.e name
-
-
-
-
-
-
-
--
-
-
-
-
-
1
-
-
-
-
-
1
1
1
1
!
1
-
-
-
-
-
-
-
-
-
-
-
-
--
-
1
1
Answers
Answered by
3
Answer:
Explanation:
Did you mean: Using Inheritance Oops concept where one class can acquire the property of another class. There is given a Dog class with one property name and class Greyhound which is a breed of dog. Greyhound inherit the property of Dog class and have some another property called color weight you have to complete the comment field in Dog class and Greyhound class i.e Dog class class Dog { private String name; - - - 1 - - 1 1. - - - - - - - 1 1 1 1 1 1 1 -- - - - - - - - - 1 1 1 I create parameterized constructor to initialize the all field i.e name - - - - - - - -- - - - - - 1 - - - - - 1 1 1 1 ! 1 - - - - - - - - - - - - -- - 1 1
Similar questions