मुझे या तो एक स्थिर या सामान्य कक्षा कब पसंद करनी चाहिए? या: उनके बीच क्या अंतर है?एक स्थिर वर्ग और सामान्य कक्षा के बीच क्या अंतर है?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace staticmethodlar
{
class Program
{
static void Main(string[] args)
{
SinifA.method1();
}
}
static class SinifA
{
public static void method1()
{
Console.WriteLine("Deneme1");
}
}
public static class SinifB
{
public static void method2()
{
Console.WriteLine("Deneme2");
}
}
public class sinifC
{
public void method3()
{
Console.WriteLine("Deneme3");
}
}
public class sinifD : sinifC
{
void method4()
{
Console.WriteLine("Deneme4");
}
sinifC sinifc = new sinifC(); // I need to use it :)
}
}
संबंधित प्रश्न http://stackoverflow.com/questions/1493862/making-methods-all-static-in-class – R0MANARMY
संभावित डुप्लिकेट [सी # - "स्थैतिक" वर्ग क्या है?] (Http: // stackoverflow .com/प्रश्न/695056/c-what-is-a-static-class) –