MATLAB: Can I import classes in an interface class in matlab

importMATLAB

Hello everyone! Can I import other classes like BaseStation,Technology and Area in the interface class BsGridFactory which are in the datatypes package and the interface class is in another package? or I should import this classes in the implementation functions of subclasses of BsGridFactory?
createBaseStationGrid takes a users parameter which is an array of User objects, an area which is an Area object and a technology which is Technology object. Is the interface class written ok or should I remove the import statements? Thanks in advance!

Best Answer

I'm not sure what you mean by import.
All import does is to allow you to refer to functions and classes in packages without having to specify the name of the package. So if you have
import datatypes.BaseStation
that means you can then write
someresult = BaseStation.SomeFunction(somearguments);
instead of
someresult = datatypes.BaseStation.SomeFunction(somearguments);
That is all. So in a context of an interface that only has abstract methods the import are useless since you're not calling any function anyway.