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
Which sorting algorithm is best?
Why does my windows application pop up a console window every time I run it?
Which is better interface or abstract class in c#?
Can you mark static constructor with access modifiers?
What is expression tree in c#?
What method is used to sort the elements of the array in descending order?
Explain how to parse a datetime string?
Define mutex in C#?
Explain About Global.asax
What is a delegate in c#?
Explain the mechanism of VB.NET/C# achieve polymorphism?
Explain about generics in c#.net?
Describe a Struct ?
Difference between type constructor and instance constructor? What is static constructor, when it will be fired? And what is its use?
Is string value type c#?