Sunday, July 26, 2009

Answers please WRT C# only?

# What is a static class?


# What is static member?


# What is static function?


# What is static constructor?


# How can we inherit a static variable?


# How can we inherit a static member?


# Can we use a static function with a non-static variable?


# How can we access static variable?


# Why main function is static?

Answers please WRT C# only?
Static classes and class members are used to create data and functions that can be accessed without creating an instance of the class.static class contains only contain static members and they cannot contain a Constructor.





Static classes cannot be inherited


we cant use a static fun with a non-static variable.


static function is used to access only the static variable.





Access a static variable using a class name.


for eg:


class ex


{


private:


static int count;


public:


user()


{


cout%26lt;%26lt;ex::count;


}


-----


}


}
Reply:That would require the first half of a C# textbook to fully cover. One question at a time please?

bouquet

No comments:

Post a Comment