我阅读了有关此问题的讨论,但找不到解决方案!
我写了一个非常简单的程序,但是当我启动它时,出现了这个错误:
<< 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;
}
}
}