Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How do you create partial methods?

1014


Are classes passed by reference in c#?

922


Why dataset is used in c#?

1022


What is private variable?

950


What is different between Boxing and Unboxing?

1069


What does the initial catalog parameter define in the connection string?

974


How do you achieve polymorphism in c#?

946


How to install or uninstall a windows service?

1074


What are get and set in c#?

1059


What are the basics of c#?

1114


What is scope c#?

922


How to use delegates with events?

1042


Why do we need static in c#?

1015


What are the features of c#?

978


What happens if you add duplicate elements to a set?

931