A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Elasticsearch in Action
this week in the
Programmer Certification (SCJP/OCPJP)
abstract - getInstance()
Joined: Feb 26, 2007
Mar 27, 2007 22:47:00
is an abstract class. So, to instantiate, you do:
d = DateFormat.getInstance();
Also, somewhere I read that abstract classes can't be instantiated. So, there is an anomaly here. Please throw soe light on it.
Also, if the 2nd statement is incorrect,
does the getInstance() mehtod apply to instantiate any abstract class?
Joined: Nov 24, 2005
Mar 27, 2007 22:58:00
What getInstance() does is basically to return a new
d = DateFormat.getInstance();[i] would be equivalent to [i]
d = new
(...)[i] with default parameters.
All roads lead to JavaRanch
rocket mass heater
subject: abstract - getInstance()
how do abstract classes like NumberFormat call the methods from their subclasses?
Simple Question regarding Abstract class
about abstract local classes
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015