0
What's the problem??
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
0
Muhammad Bilal thank you, I will need to do some more research...
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.
0
Avinesh đđ»đđ»đđ»