More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know.
Ans. A DOM (Document Object Model) parser creates a tree structure in memory from an input document whereas A SAX (Simple API for XML) parser does not create any internal structure.
A SAX parser serves the client application always only with pieces of the document at any given time whereas A DOM parser always serves the client application with the entire document no matter how much is actually needed by the client.
A SAX parser, however, is much more space efficient in case of a big input document whereas DOM parser is rich in functionality.
Use a DOM Parser if you need to refer to different document areas before giving back the information. Use SAX is you just need unrelated nuclear information from different areas.
Xerces, Crimson are SAX Parsers whereas XercesDOM, SunDOM, OracleDOM are DOM parsers.
Help us improve. Please let us know the company, where you were asked this question :
LikeDiscussCorrect / Improve  java   xml   parsers   sax   dom parser   difference   architecture   technical lead   technical architect  markup language   sax vs dom Asked in 14 Companies   frequent
Dom Parser loads the whole doument at once in memory
A DOM Parser is much more memory efficient
Dom Parser doesn't load the whole doument at once in memory
A SAX Parser is much more memory efficient
Very frequently asked. Usually asked in different variants like Diff between StringBuffer , String Builder ; Difference between StringBuilder and String class; Choice between these classes etc.
Q5. What is the difference between StringBuffer and String class ?
Ans. A string buffer implements a mutable sequence of characters. A string buffer is like a String, but can be modified. At any point in time it contains some particular sequence of characters, but the length and content of the sequence can be changed through certain method calls.
The String class represents character strings. All string literals in Java programs, such as "abc" are constant and implemented as instances of this class; their values cannot be changed after they are created.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Deployment Descriptor which is usually web.xml is used to specify the classes, resources and configuration of the application and how the web server uses them to serve web requests.This file is usually added to WEB-INF folder and contains following
* Servlet entries and url mapping
* Plugins
* Some info regarding authentication / filters
* Landing Page
* Event Handlers
Help us improve. Please let us know the company, where you were asked this question :
Ans. List - Members are stored in sequence in memory and can be accessed through index.
Set - There is no relevance of sequence and index. Sets doesn't contain duplicates whereas multiset can have duplicates.
Map - Contains Key , Value pairs.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Kafka is a distributed, partitioned, replicated commit log service. It provides the functionality of a messaging system through messages being written to logs.
Help us improve. Please let us know the company, where you were asked this question :
Ans. When we start two or more threads within a program, there may be a situation when multiple threads try to access the same resource and finally they can produce unforeseen result due to concurrency issues.
For example, if multiple threads try to write within a same file then they may corrupt the data because one of the threads can override data or while one thread is opening the same file at the same time another thread might be closing the same file.
So there is a need to synchronize the action of multiple threads and make sure that only one thread can access the resource at a given point in time. This is implemented using a concept called monitors. Each object in Java is associated with a monitor, which a thread can lock or unlock. Only one thread at a time may hold a lock on a monitor."
Help us improve. Please let us know the company, where you were asked this question :
Ans. null is a literal similar to true and false in Java. These are not keywords because these are the values of something. As null is the value of a reference variable, true is the value of a boolean variable.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Java provides a new additional feature in Array class which is used to sort array elements in parallel.New methods have been added to the java.util.Arrays package that use the JSR 166 Fork/Join parallelism common pool to provide sorting of arrays in parallel.
The methods are called parallelSort() and are overloaded for all the primitive data types and Comparable objects.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Transaction isolation levels are a measure of the extent to which transaction isolation succeeds. In particular, transaction isolation levels are defined by the presence or absence of the following phenomena:
Dirty Reads, Nonrepeatable Reads, Phantoms.
The four transaction isolation levels (as defined by SQL-92) are defined in terms of these phenomena: Read uncommitted, Read committed, Repeatable read, Serializable
Help us improve. Please let us know the company, where you were asked this question :
Ans. It is javascript framework which is written in javascript.It is best for single page application.It extends the html with new attributes which makes it more useful for ui dveloper.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Two-way binding means that any data-related changes affecting the model are immediately propagated to the matching view(s), and that any changes made in the view(s) (say, by the user) are immediately reflected in the underlying model. When app data changes, so does the UI, and conversely.
Help us improve. Please let us know the company, where you were asked this question :
Ans. A compiler directive is an instruction that tells the JVM how compilation should occur. A directive provides method-context precision in controlling the compilation process.
Help us improve. Please let us know the company, where you were asked this question :