aspose file tools
The moose likes Java in General and the fly likes javax.xml.parsers.DocumentBuilderFactory,static newInstance's concrete implementation. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "javax.xml.parsers.DocumentBuilderFactory,static newInstance Watch "javax.xml.parsers.DocumentBuilderFactory,static newInstance New topic
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: javax.xml.parsers.DocumentBuilderFactory,static newInstance's concrete implementation.
 
Similar Threads
abstarct class
Is there any means to check the number of objects created when a java prgram runs.
abstract nature with package level access?
abstract class and static methods
Can't get the result of factorial method