Dear all, I have the following code
import java.util.Scanner;
public class ex2 {
public static void main(
String args[] ) {
String name;
try
{
Scanner input = new Scanner(System.in);
System.out.println( "Please enter ur name" );
name = input.next() ;
System.out.println( "Your name is " + name);
}
catch(Exception e)
{
System.out.println("Error data type");
}
}
}
I tried compile and run on Ms Dos & eMacs. I faced problem executing the program using eMacs. It always prompt "Error data type" whereas I have no problem using MsDos at all.
I checked my
Java version on both Ms Dos and emacs which turns out both are the same. I am wondering how come the coding is nothing wrong, it provides diff result on emacs?
btw, I'm using emacs installed on Win Xp. Thanks a lot