I am getting an error(NZEC) while compiling the following programme. I am unable to figure out the error. Seems like I have done nothing wrong.
import java.util.Arrays;
import java.util.Scanner;
class mixture{
public static void main(String args[]) {
Scanner x=new Scanner(System.in);
int n;
n=x.nextInt();
int a[]=new int[n];
for(int i=0;i<n;i++) {
a[i]=x.nextInt();
}
Arrays.sort(a);
System.out.println(a[0]*a[1]);
}
}
The error I am getting is :
Main.java:4: error: class mixture is public, should be declared in a file
named mixture.java
public class mixture {
^
1 error