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
What is the difference between abstract class and interface in c#?
What is private constructor c#?
What is inheritance in csharp?
What are functions in c#?
How can you achieve run time polymorphism in C#?
What is private readonly in c#?
Is int an object in c#?
What is typeof c#?
Why static variables are used?
What are sorted lists?
What is parseexact c#?
What is the difference between dll and lib?
What are static and dynamic variables?
Is ram a heap?
What is constructor overloading in c#?