Advertisement
ipavlo

Handle different Lists

Jun 2nd, 2023
606
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.22 KB | None | 0 0
  1. public class UserHandler {
  2.     public void handle(List<User> users) {}
  3.  
  4.     public void handle(List<Profile> profiles) {}
  5. }
  6.  
  7. ///Somewhere in the code
  8.  
  9. var users = userRepo.getAllUsers();
  10.  
  11. userHandler.handle(users);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement