| Author |
javax.xml.parsers.DocumentBuilderFactory,static newInstance's concrete implementation.
|
Punya Pratap Singh
Ranch Hand
Joined: Nov 23, 2010
Posts: 74
|
|
javax.xml.parsers.DocumentBuilderFactory is a Abstract class .It has a newInstance method which returns a instance of type DocumentBuilderFactory .
how does this static method finds implementing concrete class.
Java have already gone through java docs and asking for simple and easy in depth explanation.
please explain ? Thanks
|
 |
Seetharaman Venkatasamy
Ranch Hand
Joined: Jan 28, 2008
Posts: 5575
|
|
probably, newInstance method is instantiate a class[subclass of DocumentBuilderFactory] which is implementation of DocumentBuilderFactory.
<edit>
also, google for static factory method
</edit>
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
Inside the JDK installation folder there is a file called src.zip. You can open that to see the source code of most classes.
In this case, it uses a system property for the actual class name. If the system property is not found a default one will be used.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
 |
|
|
subject: javax.xml.parsers.DocumentBuilderFactory,static newInstance's concrete implementation.
|
|
|