Interface Java Interview Questions – Set 13

Which one would you prefer and why The Runnable interface is preferred, as it does not require your object to inherit a thread because when you need multiple inheritance, only interfaces can help you. In the above example we had to extend the Base class so implementing Runnable interface is an obvious choice. Also note how … Read more

Interface Java Interview Questions – Set 12

What is JSP Implicit Objects Certain objects that are available for the use in JSP documents without being declared first. These objects are parsed by the JSP engine and inserted into the generated servlet. The implicit objects re listed below: request :It represents the request made by the client. The request implicit object is generally used … Read more

Interface Java Interview Questions – Set 11

Define TaskTracker. TaskTracker is a node in the cluster that accepts tasks like MapReduce and Shuffle operations from a JobTracker. What is the difference between HDFS and NAS? HDFS data blocks are distributed across local drives of all machines in a cluster whereas, NAS data is stored on dedicated hardware. What is the purpose of … Read more

Interface Java Interview Questions – Set 10

Performance of Set interface implementations HashSet The HashSet class offers constant-time [ Big O Notation is O(1) ] performance for the basic operations (add, remove, contains and size), assuming the hash function disperses the elements properly among the buckets. Iterating over this set requires time proportional to the sum of the HashSet instance’s size (the … Read more

Interface Java Interview Questions – Set 09

Why does JComponent have add() and remove() methods but Component does not because JComponent is a subclass of Container, and can contain other components and jcomponents. How can I implement a thread-safe JSP page? – You can make your JSPs thread-safe by having them implement the SingleThreadModel interface. This is done by adding the directive … Read more