why instance? what are the uses of instance?
Answer Posted / navin c. pandit
The object of a class is called as Instance & the process is
called as Instantiation.
To access or to call a member of a class we need instance.
eg.
public class myClass
{
public myClass()
{
}
public string show()
{
return "Hello India!";
}
}
To access method show(), we need instance of the class
myClass. And the code will be as:-
myClass obj_mc = new myClass()
string str=obj_mc.show();
Now str contains string value 'Hello India!'
Hope u have got the point.
| Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
How do you create partial methods?
Are classes passed by reference in c#?
Why dataset is used in c#?
What is private variable?
What is different between Boxing and Unboxing?
What does the initial catalog parameter define in the connection string?
How do you achieve polymorphism in c#?
How to install or uninstall a windows service?
What are get and set in c#?
What are the basics of c#?
What is scope c#?
How to use delegates with events?
Why do we need static in c#?
What are the features of c#?
What happens if you add duplicate elements to a set?