Interviews2 answers
Can we call a method of a class or ABSTRACT class without creating instance in client side.
2 Answers
By using Static method ..
Madan RoutPosted Oct 27, 2018, 6:24 AM EDT
public class myclass
{
public static void my_message()
{
Console.WriteLine("Welcome CLASS");
}
}
public abstract class myABSTRACT
{
public static void my_message()
{
Console.WriteLine("Welcome ABSTRACT");
}
}
static void Main(string[] args)
{
myABSTRACT.my_message();
myclass.my_message();
}
Adhi VenkateshPosted Mar 17, 2018, 2:32 AM EDT
