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 do you mean by streamreader/streamwriter class in c#?
Explain the Usage of web.config
What is a class level variable in c#?
What is dapper in c#?
Why do we use static class in c#?
What is a console file?
Why do we use abstraction in c#?
Is unboxing an implicit conversion?
Does c# have functions?
Which is better interface or abstract class in c#?
how to create crystal reports give one detail example(i want to view age category report) please give suitable example in my small knowledge
How can we set class to be inherited, but prevent the method from being over-ridden?
if you do have a stack overflow profile.what is your ranking?
How do I count the length of a string in c#?
Why abstraction is used in c#?