C# Beginner to advanced - Lesson 16 - What is a Constructor? Different types of constructors in C#

preview_player
Показать описание
Constructor is used to initialize an object (instance) of a class.
Constructor is a like a method without any return type.
Constructor has same name as class name.
Constructor follows the access scope (Can be private, protected, public, Internal and external).

ankpro
ankpro training
C#
C sharp
Bangalore
Rajajinagar
Selenium
Coded UI
Mobile automation testing
Mobile testing
JQuery
JavaScript
.Net
Components of the .Net framework
Hello World
Literal
Keywords
Variable
Data types
Operators
Branching
Loops
Arrays
ArrayList
Strings
String Builder
Structures
Enums
Functions
Classes
Inheritance
Polymorphism
Properties
Indexers
Events
Nested Classes
Delegates
Anonymous methods
Labda expressions
Abstract classes
Exception Handling
Linq
Interfaces
Extension methods
Anonymous types
Generics
Collections
Garbage Collection
Reflection
Attributes
Input and output statements
Type casting
Boxing and Unboxing
Var vs Dynamic vs Object
Рекомендации по теме
Комментарии
Автор

At 13:05, in case of copy constructor you have written the code like
Class Sample
{
public string param1, param2;
Public Sample(string x, string y)
{
param1=x;
param2=y;
}

My question is that in the "Sample" constructor why is the code not given like
Public Sample(string x, string y)
{
this. param1=x;
this. param2=y;
}

Why is the "this" keyword not used in the constructor??

lennonfernandes
Автор

Look closely at between 17:36 and 17:37 below tab for good clarification


BELIEVE ME U WILL GET AN OUT OF WORLD EXPERIENCE

intamdos