Advertisement

C# | Writing Methods in Classes

C# | Writing Methods in Classes This video will give you complete training in Working with Methods in Classes

For Complete C# Online Training Please visit:


Working with Methods in Classes

An instance method of a class is always invoked only using a reference to an object. Thus it has access to
all the data which is encapsulated by an object of that class.
A method requires parameter’s only for that data which it doesn’t have direct access to but is needed for
implementation of logic. Thus while writing a method in a class if that data is already the data member in
the same class do not set to it any data as a parameter or return type.
Inside a method “this” in a reference to the current object on which the method is invoked.
If the parameter/local variable and data member of a class have the same name, the local variable takes the
precedence over data member and if data member has to be accessed then “this” should be used to
resolve name ambiguity.
Whenever any of the business rules of an object or the integrity of the object is violated through a
property or a method, it should respond by throwing a runtime exception.
The class should be always programmed in such a way that, it’s not specific to any particular type of
application (Windows/Console/ClassLibrary/Service) so that the same class can be reused in different
applications/environment. For example, don’t use in class functionality like MessageBox or
Console.WriteLine or Button or Label or TextBox etc….________________________________________________________________________________________________
This video was compiled by Mr. Sandeep Soni, a Microsoft Certified Trainer and an Azure Solution Architect. Know more -

Mr. Sandeep Soni is a famous Corporate Tainer in Microsoft Azure AZ-103, AZ-203, AZ-300, AZ-301, AZ-400, AZ-500, Containerization in Docker, Microservices - Kubernetes and Azure Service Fabric and more...

For Corporate Training requests, please contact Mr. Soni @ +91 9849001840, or email him to sandeepsoni@deccansoft.com.
Or DM in LinkedIn -

Please subscribe to our channel for more related videos:

For any course-related queries, reach us @ +91 8555823343 / +91 8008327000 Kashmira Shah
Please leave your comment about the videos.

For more updates on courses and tips follow us on:
- Facebook:
- Twitter:
- LinkedIn:
- Website: or
- Join our WhatsApp group -

#deccansoft,#bestdotnettraining,#deccansoftazure,#azure,#azureappservice,#Cloud,#CloudComputing,#Security,#DevOps,#microsoftpartner,vice #Cloud #CloudComputing #Security #DevOps #microsoftpartner,

Post a Comment

0 Comments