Life,the universe and everything

it is giving an NZEC error
package easy;
import java.util.Scanner;

public class Life_universeandEverything 
{
    public static void main(String args[])
    {   
        
        int n;
        Scanner s=new Scanner(System.in);
        while((n=s.nextInt())!=42)  
              System.out.println(n); 
    }
}
//