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 does substring work in c#?
What is the implicit name of the parameter that gets passed into the class set method?
What is public or shared assemblies ?
How to reduce image resolution in C#?
Can we declare class as protected?
Enlist some of the properties of a thread class?
What is a console device?
What is deferred execution in c#?
What is xor operation?
Is there throws keyword in c#?
What is using keyword?
What is difference between dynamic and var in c#?
What is the benefit of delegate in c#?
What is instantiating a class in c#?
What are most desktop applications written in?