运行程序时,我的控制台窗口没有输出,
尝试选择不同的控制台窗口,关闭并重新打开窗口,关闭其他打开的代码
package Codecademy;
public class Continents {
public static void main(String[] args) {
//This will show a continent and the largest city
int contient = 4;
String contientString;
switch (contient) {
case 1:
contientString = "North America: Mexico city Mexico";
break;
case 2:
contientString = "South America: Sao Paulo, Brazil";
break;
case 3:
contientString = "Europe: Moscow, Russia";
break;
case 4:
contientString = "Africa: Lagos, Nigeria";
break;
case 5:
contientString = "Asia: Shanghai, China";
break;
case 6:
contientString = "Australia: Sydney, Australia";
break;
case 7:
contientString = "Antarctica: McMurdo Station, US";
break;
default:
contientString = "Invalid Selection";
break;
}
}
}
南美洲:巴西圣保罗(应该是正确的输出。)