I am trying to design my (Java) classes and I am not sure what this is called– essential it goes something like this:
MediaPlayer // contains play(String filePath) method
OtherPlayer // extends MediaPlayer and inherits play(String filePath)
MyObject // extends OtherPlayer
The problem is– I want MyObject to call play without passing the string in. MyObject contains a private member and I want to simply call,
myobject.play();
Can I have MyObject overload play() but somehow call play(String filePath) using its private string?
Edit:
I want to avoid doing this:
myobject.play(myobject.getFilePath());
Assuming
play(String)is public/protected, then simply: