More
Image
What is the difference between Read(),ReadLine() and ReadKey() Method in C sharp
By JC.Adinarayana Reddy On 24 Jan 2017
Categories: C#.net

Read(), ReadLine() and ReadKey() are basically static methods, and they comes under the Console class. That's why we use these methods like:

Console.ReadLine():-- method accept the String and return the string as well.

 

Console.Read():--method accept the String but return Integer.

Console.ReadKey():--method accept the Character and return ASCII value of that character .

Summary:

1.The above mentioned three methods are mainly used in Console application and these are used for return the different values .

2.If we use Read line or Read() we need press Enter button to come back to code.

3.If we using Read key() we can press any key to come back code in application


Comments
Message :
Comments
JC.Adinarayana Reddy
.net
.net