Can we instantiate abstract class?
Posted
by
satheesh.droid
on Stack Overflow
See other posts from Stack Overflow
or by satheesh.droid
Published on 2011-01-02T16:32:54Z
Indexed on
2011/01/02
16:54 UTC
Read the original article
Hit count: 187
I don't understand whether we can instantiate abstract class by any means because I have read we can inherit the abstract class but in have found we can create an object by calling method of other class.For example LocationProvider is an abstract class but we can create object for the same by calling getProvider() function in LocationManager class. By the following code
LocationManager lm=getSystemService(Context.LOCATION_PROVIDER)
LocationProvider lp=lm.getProvider("gps");
© Stack Overflow or respective owner