4 Answers
+ 2
First of all I added 'toString' method that is use to print different attributes of a class. Secondly I suggest you to learn more concepts of oop like encapsulation(getters/setter) ,inheritance its uses that help you in better understanding. description of tostring method https://www.sololearn.com/Discuss/2242260/?ref=app Here is your code working fine now https://code.sololearn.com/caEs0acSUP5T/?ref=app
17th Apr 2020, 8:36 PM
Muhammad Bilal
Muhammad Bilal - avatar
0
Muhammad Bilal thank you, I will need to do some more research...
17th Apr 2020, 8:43 PM
Yahel
Yahel - avatar
0
Just wanted to add few points. â–Ș When you inherit a class, you inherit everything that is either public, protected or members with no access modifier(default). â–Ș You cannot override fields, they are hidden by child class. â–Ș You can override non-static methods. â–Ș Learn and practice constructors, getter and setter methods.
17th Apr 2020, 9:05 PM
Avinesh
Avinesh - avatar
0
Avinesh đŸ‘đŸ»đŸ‘đŸ»đŸ‘đŸ»
17th Apr 2020, 9:08 PM
Yahel
Yahel - avatar