in MainFrame
class there is a method named createPerson
which takes String id
and returns Person
type.
and in my Person
class there is a method getFatherName
which returns a string.
in my Tree
class can I do the following statement ?:
String father = ( MainFrame.createPerson("001") ).getFatherName();
can i do this without creating an instance of MainFrame?
edit: i cannot create an instance of MainFrame it is a main class with GUI