Tuesday, 14 February 2012

Java Interview questions: -Show difference between SAX Parser and DOM Parser?

Following is the difference between SAX Parser and DOM Parser asked during Java interview questions.

Event based processingTree based processing
Traversing only from top to bottom that too onceTraversing can be in any direction and any number of times
Document content cannot be modified in SAXDocument content can be modified in DOM
A SAX parser serves the client application always only with pieces of the document at any given timeA DOM parser always serves the client application with the entire document no matter   how much is actually needed by the client
More space efficient in case of a big input documentis space inefficient when the document is huge

See the following video on String Literal Pool asked during java Interview:-

Click for more Java interview questions


Visit for more author’s blog on Java interview questions

1 comment: