這段程式碼如何理解?

mailwdh發表於2004-01-07
在UserManagerProxy中,有如下程式碼
public User getUser(long userID) throws UserNotFoundException {
User user = userManager.getUser(userID);
ForumPermissions userPermissions = user.getPermissions(authorization);
ForumPermissions newPermissions =
new ForumPermissions(permissions, userPermissions);
return new UserProxy(user, authorization, newPermissions);
}
其中userManager是一個介面,如何返回一個User介面呢?

相關文章