JAVA:Reading from keborad stream (not using console)
@drl0l1515-NjYedj
•
Sep 26, 2024
Sep 26, 2024
1.0K
hey @ first, I just found this forum via google, got me AGAIN somhing witch i didnt wan 😡. So i hoped I may ask...
I 1st semester in IT University, I have been doing lots of programing (for fun, to make it easyer to work, etc etc.)
Most I found on Java api and google, but I cant fin any way to reat stuff directly from the keyboard.
Example: I wanted to make a program witch does NOT need the console to get a imput over it (neather *.txt files).
For instance ( in a main class):
import java.util.Scanner;
....
....
Scanner sc = new Scanner(System in);
System.out.println(sc.nextLine());
...
with that i can read stuff from the console and output it on the console.
So does anybody know how to make that work if i make/run a program and just write it in when i have a other (or none) window in front of me?
I hope I managed to explain what my propem is, and I hope u guys can help me. thx
I 1st semester in IT University, I have been doing lots of programing (for fun, to make it easyer to work, etc etc.)
Most I found on Java api and google, but I cant fin any way to reat stuff directly from the keyboard.
Example: I wanted to make a program witch does NOT need the console to get a imput over it (neather *.txt files).
For instance ( in a main class):
import java.util.Scanner;
....
....
Scanner sc = new Scanner(System in);
System.out.println(sc.nextLine());
...
with that i can read stuff from the console and output it on the console.
So does anybody know how to make that work if i make/run a program and just write it in when i have a other (or none) window in front of me?
I hope I managed to explain what my propem is, and I hope u guys can help me. thx