Computer Science, asked by Anonymous, 1 year ago

What is the use of input stream reader in java or blue j?

Answers

Answered by Pranav777
4
In InputStreamReader Method , the user can input the values in terminal window and can get the output in the terminal windows as well.

Example : 

import java.io.*;

class InputStreamReader

{

static void test()throws IOException

{

InputStreamReader isr = new InputStreamReader(System.in);

BufferedReader br = new BufferedReader(isr);

System.out.println(“Enter the first value “);

int fstval = Integer.parseInt(br.readLine());

System.out.println(“Enter the second value “);

 

int sndval = Integer.parseInt(br.readLine());

int sum = fstval+sndval;

int product = fstval-sndval;

System.out.println(“The sum of “+fstval+” and“+sndval+” is “+sum);

System.out.println(“The product of “+fstval+” and “+sndval+” is “+product);

}

}

Hope it Helps✌️✌️

Please mark me Brainliest

Anonymous: Thanks bro
Pranav777: Please mark me brainliest when it provide the option to do so
Anonymous: Yeah man
Pranav777: Thank You
Pranav777: hello now you can mark me brainliest please do so
Answered by pranav7777777
0
Ask Google For it yoh will get answer
Similar questions