2 Replies Latest reply: May 31, 2008 10:48 AM by 567791 RSS

    User input in Jdeveloper (Scanner or Savitch class)

    567791
      Hello,

      well, sorry about the simplicity of the question but for the most simple block of code like this one, getting input from the user, the program runs and runs on the botton window below where the class is. I mean where you get a log of messages telling you how the compiling is doing. I think it is a problem of "where" the target for that runnable class is, but I have not a clue where to do it. When I worked on Unix on command line the program would continue down my lines but here, in the Jdev interface, I don't know where to input my answers to the asked questions of the block:

      import java.util.*;

      public class Test {
      public static void main(String[] args) {
      Scanner scanner = new Scanner(System.in);
      System.out.println("enter an int");
      int n = Integer.parseInt(scanner.nextLine());
      System.out.println("you entered " + n);
      System.out.println("enter a String");
      String line = scanner.nextLine();
      System.out.println("you entered " + line);
      }
      }

      I have read all about "Run configurations" etc but still puzzled :((

      Message was edited by:
      AlvaroEP