Paste in Run box: Doesnt insert enter
Answered
I am trying to do old Google Kick Start rounds to try to get better at Java.
I recently switched from Eclipse to IntelliJ and I really like it.
But when I use java Scanner and paste something it automatically runs it without enter. Screenshot:
This is a problem because it should print 3 case's (works in eclipse). I am pretty sure it is because it doesn't insert an enter when I paste.
Is there a way to solve this?
Thanks for helping!
Please sign in to leave a comment.
Could you please provide a demo project to reproduce a problem?
@... Thanks for your comment! Demo project:
public static void main(String[] args) {Scanner scanner = new Scanner(System.in);
int a = scanner.nextInt();
int b = scanner.nextInt();
System.out.println(a);
System.out.println(b);
}
Demo paste:
3
4\n
Hello, could you please clarify what is the expected behavior here? Do you expect enter to be inserted automatically after you paste 3 \n 4?