If we want to prevent instantiation of object in Java we can use several approaches and most obvious of them:
- abstract keyword
- private/protected constructor
Let's say class doesn't contain abstract methods and we use abstract keyword to prevent creation of the object. Is this approach incorrect(I mean not syntax correctness, but semantic )? Or it's better to use private constructor in such cases?
Thanks
UPD Class will be a base class for other, though it doesn't contain abstract methods. In my case it some "AbstractTestBase" which contains some common data and utility methods which can be used by some group of integration/unit tests.