SHSubjectHub

Methods and ToString (C#)

OOPA-levelLesson packSubscription

About this resource

Learn how to add methods to a C# class so objects can do things, and use ToString to control how objects display.

10 slides.

Lesson outline

  1. Methods — What Objects Can Do
  2. Adding Methods: Live Demo
  3. UML — Adding the Methods Section
  4. The Problem with `Console.WriteLine(rex)`
  5. Adding `ToString()`: Live Demo
  6. Python vs C#: `__str__` vs `ToString()`
  7. Coding Practice: The Counter Class
  8. Lesson Summary
Unit bundleUnit 1B · Methods and __str__
Part of: Unit 1B · Methods and __str__: the whole unitEvery resource in the unit in one zip.

More from Unit 1B · Methods and __str__