am I mistaking

import java.util.;
import java.lang.

class Codechef
public static void main (String[] args) throws java.lang.Exception
Scanner sc=new Scanner(;
int i=0;
while( i!=42)


whenever you are importing any package in Java, the syntax is import java..*
So it will be imported as java.util.* and import java.lang.*

You may sometimes encounter an NZEC error if there is no 42 in your custom input, as according to your code if it encounters an EOF, it will be still running though not having more inputs.

Thank you.

1 Like