Task 10b - Interfaces and Exception Handling in Java
Create a UserService Interface with following methods. void addUser(User user) void updateUser(User user) void deleteUser(int userID) User getUser(int userID) void unblockUser(int userID) void blockUser(int userID) ArrayList<User> getAllUsers() Define InMemoryUserService class that shall implement UserService contract or interface. Use ArrayList for storage, update and retrieve operations inside InMemoryUserService i.e. you shall define a static attribute ArrayList<User> users = new ArrayList<>(); The implemented methods shall change/read this list to perform the required operation. Test all methods from UserTest class. Getting information from user input is encourged but optional. Define at least id, name, and status instsance attributes in User class of type int, String and Boolean. How you check whether a user account is blocked? If status attribute is false, it means user account is blocked. True represent the account is active. Make ...