草庐IT

java - 两个 INT 变量的开关大小写

考虑以下代码:if(xPoint>0&&yPoint>0){m_navigations=Directions.SouthEast;}elseif(xPoint>0&&yPoint0){m_navigations=Directions.SouthWest;}elseif(xPoint0){m_navigations=Directions.South;}elseif(xPoint>0&&yPoint==0){m_navigations=Directions.East;}elseif(xPoint这很丑陋,我想使用switchcase,但如何使用switch与2变数?我想到了类似this的事