I have several different type of Users (different classes) in my app
User1
User2
etc…
I want to have an abstract class “User” that joins the same methods for all type of Users
ex: getId(), getAge()....
I don’t really know how that works but what i want to do is something like :
User.setType(2); //a kind a constructor
User.getId()... //etc .. the getId() method of the Users2 class
Without having to instantiate the abstract class User
How can I do that ?
The problem I have is that an abstract class can’t have static methods … and User must be static or a Singleton I don’t know what is the best.
could anyone give me some tips ?
Thank you
Abstract classes cannot be instantiated.
Even though abstract classes can have static methods, that does not quite make sense (specially when you want an abstract
Userand multiple specific types ofUsers).