0 votes
in JAVA by
Explain difference between DOM and SAX parser in Java?

1 Answer

0 votes
by
Another common Java question but from XML parsing topic. It's rather simple to answer and that's why many interviewers prefers to ask this question on the telephonic round. DOM parser loads the whole XML into memory to create a tree based DOM model which helps it quickly locate nodes and make a change in the structure of XML while SAX parser is an event based parser and doesn't load the whole XML into memory. Due to this reason DOM is faster than SAX but require more memory and not suitable to parse large XML files.

Related questions

+3 votes
asked May 13, 2021 in JAVA by rajeshsharma
0 votes
asked Oct 13, 2020 in JAVA by SakshiSharma
...