is this getName function requiring a getter in the Poodle.java subclass? If so, is there another way of calling the name as theres a restriction of not creating a getter. A hint I've gotten was "Does the Catfish class have access to the protected name field in Fish?
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Hello, is this getName function requiring a getter in the Poodle.java subclass? If so, is there another way of calling the name as theres a restriction of not creating a getter. A hint I've gotten was "Does the Catfish class have access to the protected name field in Fish?"
And a comment regarding "as a subclass of Fish it does, so an instance of Catfish should have access to it's parent class variables, even within another class." but I'm still kinda confused.
Step by step
Solved in 3 steps