if(p instanceof Architect)
{if(numberOfArchitect==1)
throw new TeamException("团队中至多只能有一名架构师");}
else if(p instanceof Designer) {
if(numberOfDesigner==2)
throw new TeamException("团队中至多只能有两名设计师");}
else if(p instanceof Programmer) {
if(numberOfProgrammer==3)
throw new TeamException("团队中至多只能有三名程序员");}
和
if(p instanceof Architect&&numberOfArchitect==1)
throw new TeamException("团队中至多只能有一名架构师");
else if(p instanceof Designer&&numberOfDesigner==2)
throw new TeamException("团队中至多只能有两名设计师");
else if(p instanceof Programmer&&numberOfProgrammer==3)
throw new TeamException("团队中至多只能有三名程序员");
的意思居然不一样