Hi Venkat Please add this topic in text also. Besides this, I would request you one thing, your blog opens with VPN in office. Could you please make it available in office network so that anyone can read the articles in office network also.Thanks
Hi Venkat, I am learning C# from your youtube channel, its a great help for guys like me, and I appreciate you for the same. I have a question for you, I have learned about static and instance class methods, but I am finding myself unable to decide that in which scenario or situation I should make the method static or keep it instance method. How to decide this? Kindly help me with some simple example. But kindly notice that I am an absolute beginner hence illustrate this me in simplest way possible. Thanks very much in advance.
hi Kumar, i think we should use Static method if the method is useful, we need use it lots of times. in that case, if we set the method as intance method, we need to invoke a instance class every time to use that method, the cost of the memory is too huge. So as my understanding, we should use Staic method if the method always be called, such as Console.writeLine(). it's just my personal idea, hope we can share ideas.
as far as I understand return statement is declared at the end of your class statements and thus it returns a value as required , in other words your compiler expects to end the program once you return the value
I have asked the same question to my tutor he said that since return statement once executed brings u out of that block or loop so statements written after (Return) are unreachable.
Great Videos thank you I was getting lost at school but these videos are really helping me to understand what is going on
ReplyDeletevery good Videos for free of cost...Thanks Gr8 help
ReplyDeleteHi Venkat
ReplyDeletePlease add this topic in text also. Besides this, I would request you one thing, your blog opens with VPN in office. Could you please make it available in office network so that anyone can read the articles in office network also.Thanks
Hi Venkat, I am learning C# from your youtube channel, its a great help for guys like me, and I appreciate you for the same.
ReplyDeleteI have a question for you, I have learned about static and instance class methods, but I am finding myself unable to decide that in which scenario or situation I should make the method static or keep it instance method. How to decide this? Kindly help me with some simple example. But kindly notice that I am an absolute beginner hence illustrate this me in simplest way possible. Thanks very much in advance.
hi Kumar, i think we should use Static method if the method is useful, we need use it lots of times. in that case, if we set the method as intance method, we need to invoke a instance class every time to use that method, the cost of the memory is too huge. So as my understanding, we should use Staic method if the method always be called, such as Console.writeLine().
Deleteit's just my personal idea, hope we can share ideas.
Asking a question to replied one,
Deleteinstance members are took too much of memory then why we are using instance members/methods instead of static once
Hi Venkat,
ReplyDeleteWhy I cannot write Console.Writeline(This is instance constructor ); below the return statement ?
as far as I understand return statement is declared at the end of your class statements and thus it returns a value as required , in other words your compiler expects to end the program once you return the value
DeleteI have asked the same question to my tutor he said that since return statement once executed brings u out of that block or loop so statements written after (Return) are unreachable.
DeleteThank you for this great detailed presentation on Static and Instance Members. I was all confused till now. Your are an excellent instructor.
ReplyDeleteJonathan
sir i am new in c# i have no idea about C#.So plz teach me the Basic things Of c#.very thankul to u.
ReplyDeletetext
ReplyDeleteclass Circle
{
static float _PI = 3.141f;
int _Radius;
public Circle(int Radius)
{
this._Radius = Radius;
}
public float ClacArea()
{
return Circle._PI * this._Radius * this._Radius ;
}
~Circle ()
{
//Clean up Code
}
}
static void Main(string[] args)
{
Circle c1 = new Circle(5) ;
float Area= c1.ClacArea();
Console.WriteLine("Area {0}", Area);
Circle c2 = new Circle(6);
float Area2 = c2.ClacArea();
Console.WriteLine("Area {0}", Area2);
}