STATIC METHOD CAN BE OVERLOADING AND OVERIDNG? IS POSSIBLE IN
iN c# .NET AND WHAT IS THE REASON??

Answers were Sorted based on User's Feedback



STATIC METHOD CAN BE OVERLOADING AND OVERIDNG? IS POSSIBLE IN iN c# .NET AND WHAT IS THE REASON?? ..

Answer / sudhir sheoran

Static Methods can't be override because static methods can only be accessed using class name and are inaccessible to the objects of the class. So no question of overriding.

But canbe overloaded. See the below example:

class Program
{
static void Main(string[] args)
{
abc.calculate(2, 3);
abc.calculate(2.0, 3.9);
Console.ReadLine();
}
}
public static class abc
{
public static void calculate(int a,int b)
{
Console.WriteLine("Int");
}
public static void calculate(double c,double d)
{
Console.WriteLine("Double");
}
}

Is This Answer Correct ?    25 Yes 1 No

STATIC METHOD CAN BE OVERLOADING AND OVERIDNG? IS POSSIBLE IN iN c# .NET AND WHAT IS THE REASON?? ..

Answer / dinesh sharma

In C# Static Method is Overloaded but not override because override always used in drive class.but in case of static can not provide inheritance.

Is This Answer Correct ?    9 Yes 0 No

STATIC METHOD CAN BE OVERLOADING AND OVERIDNG? IS POSSIBLE IN iN c# .NET AND WHAT IS THE REASON?? ..

Answer / maheshbabuummaneni

STATIC METHOD CANT BE OVERLOAD AND OVERIDE.I DONT NO EXACT REASON.................

Is This Answer Correct ?    4 Yes 12 No

Post New Answer

More C Sharp Interview Questions

What?s a satellite assembly?

2 Answers  


How many keyword present in C# language ?

0 Answers   HCL,


What is a partial class. Give an example?

0 Answers  


What is using keyword?

0 Answers  


Wcf and what is difference between wcf and web services?

0 Answers  






How Global.asax is used ?

0 Answers   Siebel,


What are static and dynamic variables?

0 Answers   CGI,


What is a console?

0 Answers  


What is iqueryable?

0 Answers  


Describe the types of comments in c#?

0 Answers  


Explain partial class in c#?

0 Answers  


What is difference between var dynamic and object in c#?

0 Answers  


Categories