i am not able to understand the logic of these process,
please help me to understand what these lines doing here step by step
{
InputStream c = System.in;
Reader c1 = new InputStreamReader(c);
BufferedReader bf = new BufferedReader(c1);
name=bf.readLine();
number=bf.readLine();
}
and why i can not use c1, bf, or c variable after these line again?
I forgot input process Logic and i am not able to understand it now, please help me
Under discussion
Comments (2)
- Popular
- New
- Old
You must be signed in to leave a comment
Robert P
29 October 2018, 22:44
Depending on where you have initialized these variables, they become 'locked'. They are dependent on each other in sequence. They're also tied to internal code through the methods being called, if you try to change them later in the code, it will break the function of these methods.
To the best of my knowledge
System.in == Console input
InputStreamReader == Internal function to translate System.in
BufferedReader == Internal function that acts to mediate, and verify that the InputStreamReader is translating properly.
This is a standard best practice to condense all these functions into one line, memorize it.
The BufferedReader will take any input and store it as a String type. So if you want to use the BufferedReader to store a different type, you must use another function to turn it into that type.
0
Md Sait
29 October 2018, 13:57
Please Somebody Help
0