Java Interview Questions

Java Questions

  1. What is the Collections API? - The Collections API is a set of classes and interfaces that support operations on collections of objects
  2. What is the List interface? - The List interface provides support for ordered collections of objects.
  3. What is the Vector class? - The Vector class provides the capability to implement a growable array of objects
  4. What is an Iterator interface? - The Iterator interface is used to step through the elements of a Collection
  5. Which java.util classes and interfaces support event handling? - The EventObject class and the EventListener interface support event processing

Java Questions II

  1. What is the Collection interface? - The Collection interface provides support for the implementation of a mathematical bag - an unordered collection of objects that may contain duplicates
  2. What is the Set interface? - The Set interface provides methods for accessing the elements of a finite mathematical set. Sets do not allow duplicate elements
  3. What is the purpose of the enableEvents() method? - The enableEvents() method is used to enable an event for a particular object. Normally, an event is enabled when a listener is added to an object for a particular event. The enableEvents() method is used by objects that handle events by overriding their event-dispatch methods.

Java Questions III

  1. What are the high-level thread states? - The high-level thread states are ready, running, waiting, and dead
  2. What happens when a thread cannot acquire a lock on an object? - If a thread attempts to execute a synchronized method or synchronized statement and is unable to acquire an object’s lock, it enters the waiting state until the lock becomes available.
  3. How does multithreading take place on a computer with a single CPU? - The operating system’s task scheduler allocates execution time to multiple tasks. By quickly switching between executing tasks, it creates the impression that tasks execute sequentially.

Common JSP Interview Questions

  1. What are the implicit objects? - Implicit objects are objects that are created by the web container and contain information related to a particular request, page, or application. They are: request, response, pageContext, session, application, out, config, page, exception.
  2. Is JSP technology extensible? - Yes. JSP technology is extensible through the development of custom actions, or tags, which are encapsulated in tag libraries.

Common JSP Interview Questions II

  1. Is there a way I can set the inactivity lease period on a per-session basis? - Typically, a default inactivity lease period for all sessions is set within your JSP engine admin screen or associated properties file. However, if your JSP engine supports the Servlet 2.1 API, you can manage the inactivity lease period on a per-session basis. This is done by invoking the HttpSession.setMaxInactiveInterval() method, right after the session has been created. For example:
      <%
      session.setMaxInactiveInterval(300);
      %>

    would reset the inactivity period for this session to 5 minutes. The inactivity interval is set in seconds.

Pages (21): « First ... « 4 5 6 [7] 8 9 10 » ... Last »