I'm not sure if I'm following, are you talking about something like IntelliSense (Visual Studio), or are you wanting to see the results of the code that you wrote? If it's the first, then Eclipse should do that by default. If it's the second thing, then you need to debug the program. However, you need a working project to be able to debug (i.e. you have some initializing class with main).
English
-
Yea I have an initialing class with main, I hit 'debug', the code ran and then displayed the output in the console but now I can't even type in the console. How do I type in the console?
-
Edited by CostlyAxis: 6/9/2013 6:21:56 PMYou should look into Scanners if you want to keep it simple (and you don't plan to do anything too heavily spectacular). [url=http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Scanner.html]You can read about them here[/url]. Edit: For clarification, Eclipse does support input from the keyboard. It looks like the issue might be that you never wrote anywhere in the code to check for input from an external device (i.e. a keyboard)
-
Edited by dazarobbo: 6/9/2013 6:18:08 PMSystem.out.println("Java sucks"); That's the regular way which just gets sent to stdout which I also know works in NetBeans. You could also try System.err.println() which will print to stderr. Edit: Oh, you want stdin?
-
Wait no, basically, after I run the code, this console opens up in the bottom and has all the outputs of my code. Suppose my code is public static void add(int x, int y){ System.out.println(x + y); } and then after I run the code, is there an interactive debug console where I can just try, add(4, 5) and then add(6, 7).. and then just try whatever I want?
-
Easy!! Code that section of the code into a loop, and prompt for input :P
-
Hmm. I don't think there is by default at least. Unlike scripting languages, you cannot easily just store a procedure in memory and call it interactively without prior setup. If that is a feature you want, you'll probably have to check if there are any extensions available for Eclipse.
-
I think he wants something like CMD.