Skip to main content

The difference of Read(),ReadLine() and Readkey() method are given below:

Read():This is static method in Console class:

   int i = Console.Read();//it always return int value.
   Console.WriteLine(i);

paste above code and give input '1', and the output will be 49. That is Console.Read give int value but that value will be the ASCII value of that.. ReadLine

ReadLine():

  string s= Console.ReadLine();//it always return string value.
  Console.WriteLine(s);

It gives the string as it is given in the input stream.

ReadKey(): this method is used to hold the output screen.when any key is press. Read() and ReadLine() is used the enter key for exit.

The difference of Read(),ReadLine() and Readkey() method are given below:

Read():This is static method in Console class:

   int i = Console.Read();//it always return int value.
   Console.WriteLine(i);

paste above code and give input '1', and the output will be 49. That is Console.Read give int value but that value will be the ASCII value of that.. ReadLine():

  string s= Console.ReadLine();//it always return string value.
  Console.WriteLine(s);

It gives the string as it is given in the input stream.

ReadKey(): this method is used to hold the output screen.when any key is press. Read() and ReadLine() is used the enter key for exit.

The difference of Read(),ReadLine() and Readkey() method are given below:

Read():This is static method in Console class:

int i = Console.Read();//it always return int value.
Console.WriteLine(i);

paste above code and give input '1', and the output will be 49. That is Console.Read give int value but that value will be the ASCII value of that.

ReadLine():

string s= Console.ReadLine();//it always return string value.
Console.WriteLine(s);

It gives the string as it is given in the input stream.

ReadKey(): this method is used to hold the output screen.when any key is press. Read() and ReadLine() is used the enter key for exit.

Source Link

The difference of Read(),ReadLine() and Readkey() method are given below:

Read():This is static method in Console class:

   int i = Console.Read();//it always return int value.
   Console.WriteLine(i);

paste above code and give input '1', and the output will be 49. That is Console.Read give int value but that value will be the ASCII value of that.. ReadLine():

  string s= Console.ReadLine();//it always return string value.
  Console.WriteLine(s);

It gives the string as it is given in the input stream.

ReadKey(): this method is used to hold the output screen.when any key is press. Read() and ReadLine() is used the enter key for exit.