hank1
asked on
instance of an abstract class
take Calendar
On the API page it is described as an abstract class, yet you
obtain it with it's static getInstance method. Please explain.
Everywhere I turn instructors say you can not get an object
of an abstract class. Does getInstance build something else?,
something which extends Calander?
Thanks
On the API page it is described as an abstract class, yet you
obtain it with it's static getInstance method. Please explain.
Everywhere I turn instructors say you can not get an object
of an abstract class. Does getInstance build something else?,
something which extends Calander?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Usually GregorianCalendar:
System.out.println(Calenda r.getInsta nce().getC lass());
System.out.println(Calenda
ASKER
So you can call static methods of abstract classes.
THis, and who know why, also works Cal.. c = new Cal...()
I didn't think you could do that either.
Thanks
THis, and who know why, also works Cal.. c = new Cal...()
I didn't think you could do that either.
Thanks
:-)
>> So you can call static methods of abstract classes.
yes
>>THis, and who know why, also works Cal.. c = new Cal...()
No it won't compile
>> So you can call static methods of abstract classes.
yes
>>THis, and who know why, also works Cal.. c = new Cal...()
No it won't compile
something which extends Calander?
Yes