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 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 |
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 CANT BE OVERLOAD AND OVERIDE.I DONT NO EXACT REASON.................
| Is This Answer Correct ? | 4 Yes | 12 No |
Describe how a .net application is compiled and executed
What is null in database?
How do I download a program to my desktop?
An Array is a Ref Type? what about the array elements which are value type(int,Float...etc)?
What is the difference between C# 3.5 and C# 4.0?
When should we use sealed class in c#?
What?s the difference between System.String and System.StringBuilder classes?
can u tell me any one steps for creatting sn.k
Integer at long type variable are not object.Support your answer with example.And explain the technique to convert from value type to reference type and vice-versa.
explain the nature of the assembly work?
What is escape sequence in c#?
Is string a primitive data type in c#?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)