Strange how the "new" operator is looking so limited at the moment: it must allways return a new object (not an already existing link to some static object) and it must be a class of the type used in the operator (not a subclass of that type).

The usual naming is createSomething rather than newSomething is it not? getSomething seems to be used where there is a backing cache and you don't expect it to return a unique instance.

The most intuitive name for me would be simply make(args) or create(args). No need for the extra word. Java is already clutered with unnecessary long names.

Ey, in your code you can do what you want, simply use create(), nobody restricts you there, if you think this is enough. But imagine you've got a factory-class that can create A-objects and B-objects. Then it would for sure be a good way to call the methods

But imagine you've got a factory-class that can create A-objects and B-objects. Then it would for sure be a good way to call the methods

When you create an object from a factory isn't it irrelevant what the real class of the object is ? You are going to work with it using the common base class interface anyway. If you need to make that distinction then perhaps you shouldn't use a factory and create the object directly from its class.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org