Core Java Interview Questions – Set 13

Why main() in java is declared as public static void main? What if the main method is declared as private? Public – main method is called by JVM to run the method which is outside the scope of project therefore the access specifier has to be public to permit call from anywhere outside the application … 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

Core Java Interview Questions – Set 12

Can a double value be cast to a byte Yes, a double value can be cast to a byte. Is the ternary operator written x : y ? z or x ? y : z It is written x ? y : z. Can an abstract class be final An abstract class may not be declared as final. What is the difference … 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

Core Java Interview Questions – Set 11

What is Domain Naming Service(DNS)?- It is very difficult to remember a set of numbers(IP address) to connect to the Internet. The Domain Naming Service(DNS) is used to overcome this problem. It maps one particular IP address to a string of characters. For example, www. mascom. com implies com is the domain name reserved for … Read more

JSP Java Interview Questions – Set 10

What do you understand by client side and server side templating The modern Rich Internet Applications (RIA) use the design concept of “single page web design”, where a single rich page makes ajax based service calls to render different sections of a page instead of the traditional approach of loading a new page of each user action.The “single page web design” … 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

Multi Threading Java Interview Questions – Set 10

Explain different ways of creating a thread Threads can be used by either: Extending the Thread class. Implementing the Runnable interface. Using the Executor framework (this creates a thread pool) By extends: class Counter extends Thread { //method where the thread execution will start public void run(){ //logic to execute in a thread } //let’s see how to start the … Read more

Core Java Interview Questions – Set 10

What methods are used to get and set the text label displayed by a Button object? getLabel() and setLabel(). What is the difference between choice and list? ?– A Choice is displayed in a compact form that requires you to pull it down to see the list of available choices and only one item may be selected … Read more

JSP Java Interview Questions – Set 09

What types of comments are available in the JSP? There are two types of comments that are allowed in the JSP. They are hidden and output comments. A hidden comment does not appear in the generated HTML output, while output comments appear in the generated output. Example of hidden comment: < % – – This … Read more