why the following code generate compile time error?
import java.util.*;
public class hasmat
{
public static void main(String args[])
{
long a, b=9;
Scanner test = new Scanner(System.in);
while(test.hasNextLong())
{
a= test.nextLong();
if(test.hasNextLong())
b= test.nextLong();
if(a>b)
System.out.println(a-b);
else
System.out.println(b-a);
}
}
}
Why this code generate compile time error?
Moderator: Board moderators