why instance? what are the uses of instance?

Answers were Sorted based on User's Feedback



why instance? what are the uses of instance?..

Answer / 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

why instance? what are the uses of instance?..

Answer / gg

create memory for that object in heap

Is This Answer Correct ?    1 Yes 0 No

why instance? what are the uses of instance?..

Answer / yathirajulu

instace is the way to access members(methods) in that
class,by this instance to invoke the methods.

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More C Sharp Interview Questions

What are the generation of Garbage Collection in C# .NET ?

0 Answers   MCN Solutions,


What is the difference between final finally and finalize in c#?

0 Answers  


Can a class or a struct have multiple constructors?

0 Answers  


What does virtual keyword mean ?

6 Answers   TCS,


Why do we use abstract class in c#?

0 Answers  


in a town the percentage of total men is 52. the percentage of total literacy is 48. if total percentage of literate men is 35 of total population. write a program to find out the total no of illiterate men and women.

3 Answers   HCL,


What is sqldatareader c#?

0 Answers  


Is c sharp free?

0 Answers  


What is visual c# net?

0 Answers  


Which property do we set on a Combo Box to display data on it prior to setting the DataSource ?

0 Answers   Siebel,


What is anonymous types in c#?

0 Answers  


How does dependency injection work c#?

0 Answers  


Categories