Join Reynald Adolphe for an in-depth discussion in this video Method overloading, part of C# Best Practices for Developers.
- [Instructor] In this chapter, I'd like to talk about…naming and handling methods, fields, and properties.…And we're going to start off with methods.…Specifically, with the concept of overloading methods.…Now, method overloading is used to create methods…with the same name and purpose but different signatures.…So there's a few things to point out.…One is that the method names must be the same.…Two, the number or type of parameters must be different.…
And that three, the return type isn't taken into account.…So let's demonstrate an example.…I'm going to navigate to our Actor class,…and we're going to create two methods called BookActor…that'll have different numbers of parameters.…And the purpose of these methods…is to indicate that the actor has been booked…for some type of job.…I'll scroll down to where we have our methods.…
And this is something that I definitely want to remind…and point out, is that it's important…to keep everything in order.…It's common practice to have your properties…on top of your methods…
- Naming and handling classes
- Running a unit test
- Using constructors
- Naming and handling methods, fields, and properties
- Using properties correctly
- Managing objects efficiently
- Common design patterns as best practices
Skill Level Intermediate
1. Best Practices: An Overview
2. Naming and Handling Classes
3. Naming and Handling Methods, Fields, and Properties
4. Managing Objects Efficiently
5. More Best Practices Resources
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.