我讀了關於這個問題的討論,但我找不到解決方案!奇怪的錯誤發射Java(Eclypse)
我寫了一個非常簡單的程序,但是當我啓動它,會出現這樣的錯誤:
<< Selection does not contain a main type >>
非常感謝您提前向誰幫我。我的Java新:/
public class Implementation{
public static void Main(String args[]){
Operations_numbers operations;
operations = new Operations_numbers();
int subtraction = operations.subtraction(10,2);
String result_Comparison = new String();
result_Comparison = operations.comparison(8,3);
System.out.println(result_Comparison);
System.out.println(subtraction);
}
}
---------------
public class Operations_numbers{
public int subtraction (int x, int y){
int subtraction;
subtraction=x-y;
return subtraction;
}
public String comparison (int x, int y){
if(x>y){
String result="the number" + x + "is bigger than the number" + y;
return result;
}
else{
String result="the number" + y + "is bigger than the numbero" + x;
return result;
}
}
}
非常感謝你們大家!你非常快! 現在我很慚愧我的問題,這是一個非常小而愚蠢的細節。 我希望我能在將來成爲一名優秀的程序員時爲您提供幫助! andrea – user1895798