Maybe I'm wrong, because I do not have too much experience with Java, but here's the question.
I have a class that contains many methods (basically this is a simple library).
I create an object of this class, say MyLibrary obj = new MyLibrary(parameters);
The parameters set the necessary functionality for the library to work properly.
Then I can call obj.getSomething / obj.setSomething / obj.createSomething etc. etc....
In my main class, I really need only one such library object.
Now ... It would be more useful for me not to use it as an object, but to put it as extends , and then create a function inside the library, such as a constructor, which I would call manually?
EDIT:
The connection between one class and MyLibrary is very close. Basically, I have many classes that do similar things, but have several different higher level functionalities. Therefore, I highlighted the method that should be in all these classes.
It seems to be very similar to the shape and triangle class, circle , square . So, MyLibrary is like a shape that contains all the MyLibrary .
source share