I have an arraylist that I want normal users to only be able to GET information from and then I have an administrator account that I want to be able to do SET, SORT, and other methods to the arraylist. How do I share this array list with my administrator account and normal user accounts while also having different functionality to users depending on who they are. I guess I am asking how to add new methods to a class from a subclass. Please tell me the pros and cons to the way you go about solving my problem. The reason I don't have any code right now is because I am in the planning phase of my project and I just need to know if this is possible. Thanks!
Tell me more
×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
You can return a Collections.unmodifiableList() for the underprivileged consumers. | |||
|
You can make a list readonly by using Collections.unmodifiableList() You don't give much details in your question, but here is an example of how it could work. Assuming that you have an object that allows you to get a hold of an array based on a
| |||||
|