public class SmallestIndex {
//This method returns the index of the smallest value in the array of given size
private static int arrSize = 0;
public static void smallestIndex (int[] array) {
int currentValue = array[0];
int smallestIndex = 0;
for (int j=1; j < arrSize; j++) {
if (array[j] < array[smallestIndex])
smallestIndex = j;
}
System.out.println();
System.out.println("The smallest index is: "+ smallestIndex);
}
}
it compiles correctly but when run program this error come
--------------------Configuration: my - JDK version 1.6.0_27 <Default> - <Default>--------------------
java.lang.NoSuchMethodError: main
Exception in thread "main"
Process completed.
so to correct this when i put the static void main(String[]args) so many other errors come again!!!
pls help me correcting this... your members help is greatly appreciated..
thank you!!