Give a simple example of Static class?

 Posted by vishalneeraj-24503 on 1/23/2014 | Category: C# Interview questions | Views: 5373 | Points: 40
Answer:

public static class static_class

{
public static string status;//Static variable

public static void print() //static method
{
}
}

public class non_static_class
{
//we must not need to create object of static_class
string Status = static_class.status;
static_class.print();
}


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response