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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top