What is the difference between BufferedReader and input using command line arguments in Java? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

What is the difference between BufferedReader and input using command line arguments in Java?

I have used BufferedReader for taking input and also Command line argument but wanted to know the difference they make while taking input .... (Code for Buffered Reader) https://code.sololearn.com/c1Xm3W7w2dJq/?ref=app

6th Aug 2018, 11:45 AM
Chandani Mourya
Chandani Mourya - avatar
3 Answers
+ 8
Command line arguments are provided prior to the program being executed. Receiving input from System.in via BufferedReader (or Scanner) happens during runtime.
6th Aug 2018, 12:15 PM
Hatsy Rei
Hatsy Rei - avatar
+ 6
Hatsy Rei will it make any difference in the program when I use one of them??😅
7th Aug 2018, 11:45 AM
Chandani Mourya
Chandani Mourya - avatar
+ 6
Chandani Mourya Hatsy Rei ...thank you first for posting the question and secondly for the answer it helped me 😅..
9th Aug 2018, 10:32 AM
$hardul B
$hardul B - avatar