问题描述
我正在尝试修复此代码以返回最小值,但我不断收到此错误。 Java Eclipse中的选择不包含主类型错误。
公共类MinimumValue {
public static int main(int [] arrayOfInts,int n){
int currmin = 100;
for(int i = 0; i< n; i ++){
if(arrayOfInts [i]> currmin)
currmin = arrayOfInts [i];
System.out.println(i);
}
返回currmin;
}
}
我尝试了什么:
我试过配置构建路径指向正确的文件,但我仍然收到此错误,任何提示?
I am trying to fix this code to return the minimum value, but i keep getting this error. "Selection does not contain a main type" error in Java Eclipse.
public class MinimumValue{
public static int main(int[] arrayOfInts, int n) {
int currmin = 100;
for (int i = 0; i < n; i++) {
if (arrayOfInts[i] > currmin)
currmin = arrayOfInts[i];
System.out.println(i);
}
return currmin;
}
}
What I have tried:
I tried configuring the build path to point to the correct file but I am still getting this error, any tips?
推荐答案
这篇关于选择不包含java eclipse中的主类型错误。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!