如何在 Eclipse 中修复没有输出到控制台 window
how to fix no output to console window in eclipse
当 运行 程序我没有输出到我的控制台 window,
尝试选择不同的控制台 windows、关闭并重新打开 window、关闭其他打开的代码
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;
}
}
}
南美洲:巴西圣保罗(应该是正确的输出。)
那么应该是这样的:
int contient = 4;
String contientString;
switch (contient) {
case 1:
contientString = "North America: Mexico city Mexico";
break;
case 2:
contientString = "Some 2nd Continent: Some 2d City Some2ndCountry";
break;
case 3:
contientString = "Some 3rd Continent: Some 3rd City Some3rdCountry";
break;
case 4:
contientString = "Some 4th Continent: Some 4th City Some4thCountry";
break;
default:
contientString = "Don't Know What Continent: UNKNOWN";
}
System.out.println(contientString);
当 运行 程序我没有输出到我的控制台 window,
尝试选择不同的控制台 windows、关闭并重新打开 window、关闭其他打开的代码
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;
}
}
}
南美洲:巴西圣保罗(应该是正确的输出。)
那么应该是这样的:
int contient = 4;
String contientString;
switch (contient) {
case 1:
contientString = "North America: Mexico city Mexico";
break;
case 2:
contientString = "Some 2nd Continent: Some 2d City Some2ndCountry";
break;
case 3:
contientString = "Some 3rd Continent: Some 3rd City Some3rdCountry";
break;
case 4:
contientString = "Some 4th Continent: Some 4th City Some4thCountry";
break;
default:
contientString = "Don't Know What Continent: UNKNOWN";
}
System.out.println(contientString);