simple example that I should know

  • Thread starter Thread starter Tony Johansson
  • Start date Start date
T

Tony Johansson

Hello!

Why is it possible to use an object in the writeLine method see below when
it's actually an object. In this example testing is an object and
not a string.
How does the WriteLine method know that it is a string to be written.

object testing = "Testing";
Console.WriteLine(testing);

//Tony
 
Ok the writeLine method get this testing object by using the overload that
takes an object
but how can the string be written when the WriteLine method is using an
object for this string literal.

//Tony
 
Back
Top