0

What are we passing to the ReadLine () method?

What are we passing to the ReadLine () method? If you pass arguments to it like this: ReadLine ("Hello people") it will be an error because ReadLine () does not accept arguments. What do we transmit then?

26th Nov 2021, 6:25 PM
‎أندريه‎
‎أندريه‎ - avatar
5 odpowiedzi
+ 7
ReadLine() is used without any parameter and it takes the entered values by user at console. Below is the lesson regarding this read and do some handson over that https://www.sololearn.com/learn/CSharp/2585/?ref=app
26th Nov 2021, 6:37 PM
GAWEN STEASY
GAWEN STEASY - avatar
+ 2
We cannot pass anything to ReadLine() since it is a data input method without an argument.
26th Nov 2021, 6:39 PM
Solo
Solo - avatar
+ 1
If you do not enter anything, then ReadLine will not display anything, not even a space: Console.WriteLine("Hello "+Console.ReadLine()+"!");
26th Nov 2021, 7:03 PM
Solo
Solo - avatar
27th Nov 2021, 12:37 AM
Ipang
0
That is, if you call the ReadLine () method without assigning the value passed from the user to any variable, then it will be like an empty variable of the string type because ReadLine () stores information as a string
26th Nov 2021, 6:45 PM
‎أندريه‎
‎أندريه‎ - avatar