In android studio, when I run a simple code to get an integer number, it gives me an error regarding the Scanner class.
import java.util.Scanner;
public class MyClass {
public static void main(String[] args){
Scanner yadigar = new Scanner(System.in);
int a = yadigar.nextInt();
System.out.println("a");
}
}
I just expected it to print a number but unlike eclipse and other IDEs it gave an error. I actually tried to modify gradle, but it did not work(maybe I did something wrong, I am not sure honestly). Execution failed for task ':yad:MyClass.main()'.
Process 'command 'C:/Program Files/Android/Android Studio/jre/bin/java.exe'' finished with non-zero exit value 1
- Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.