Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Intermediate C#!
You have completed Intermediate C#!
Preview
All objects can be converted to a string using ToString. We get to decide what we want that conversion to be.
This video doesn't have any notes.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
To get to know this method,
let's go into the C# REPL.
0:00
Let's create an empty class named Shoe.
0:03
Because Shoe inherits from System.Object,
it has the ToString method.
0:09
ToString is an instance method, so
0:15
we'll need to create an instance of Shoe,
and now we can call ToString on it.
0:18
ToString just returned a string that
contained the name of the class.
0:25
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up