JAVA:Reading from keborad stream (not using console)

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

Replies

  • faizaan
    faizaan
    hi,

    i hope you will get your answer if you read about

    character stream and byte stream from any book.

You are reading an archived discussion.

Related Posts

HEy there! I am Saira and currently doing COmputer Engineering from NUST. just ended my 6th semester! Right now doing internship! i joined this forum because whenever i googled any...
This is a video of an amazing slot mortising machine that is made mostly from wood. YouTube - Multi slot mortising machine
Hi, How can I add circuit here? I have some problem that want to share. In my posting rules it is showing "You may not post attachments". Please help
We all know that google covers a significant market in search engines. Here and there, we all uses search engine (Specifically mentioning Google) in our daily life. This thread is...
I know that Google and Bing are in the same business (searching), I was just wondering how much similar they are, BING is just similar to Google in the pattern...