Is there another way to pass information to a class from another class besides a Method or a Constructor?
My professor in my Java Class told us not to pass any values to the constructor (leaving it as a default Constructor) and not to create any public methods in the class. So If I have data in one class and I need to pass it to another class what is the best method to do this?
I thought about setting up a private method with a parameter list but if it is private doesn't that mean it is only usable in that same class??
My professor in my Java Class told us not to pass any values to the constructor (leaving it as a default Constructor) and not to create any public methods in the class. So If I have data in one class and I need to pass it to another class what is the best method to do this?
I thought about setting up a private method with a parameter list but if it is private doesn't that mean it is only usable in that same class??