This tutorial post highlights the important difference between JSP and Servlet technologies. Servlet and JSP are the two key Java server side technologies that are building blocks for any of the Java web frameworks. It is important to know the difference between these two technologies. This is one of the fundamental concept that confuses the many …
Finalize Method – OCPJP 6
2) What will be the output of the following program? The program will output ‘finalize’. It is unsure that the finalize() method will be called by the Garbage Collector. As soon the object reference ‘object’ is set to null, there is a possibility that the method ‘finalize()’ will be called. The program will cause compile-time …
Console API – OCPJP 6
5) What will be the output of the following program? The program will output ‘100.000000 – 100’. The program will output ‘100 – 100.000000’. The program will throw a IllegalFormatConversionException at run-time. The program will output ‘100 – 100’. Get more questions on Console Answer 5) b. Here the ordering of the arguments (anInt and …
NavigableMap – OCPJP 6
NavigableMap is similar to NavigableSet. In NavigableMap we will use key value pairs to reterive the value. see the following code: Look into the following code snippet: In tha bove code NavigableMap API is used for reteriving the less than and greater than value based on key. The output would be like this: 2) What will be the output of the …
NavigableSet – OCPJP 6
NavigableSet API is included in the ocpjp 6 certification exam. This article explains few important methods with simple example program.NavigableSet is the subinterface of SortedSet. This interface defines methods for finding the element in a list. For example lower() method used for finding the element which is less than the given value. Look into the following example: In the …
sendRedirect in Servlet
Java EE Tutorials Servlets Tutorials Servlets Interview Questions In this article we shall see how to redirect your current page to some other page. The easiest way to achieve this is by using the sendRedirect() method of class javax.servlet.http.HttpServletResponse. sendRedirect() method redirects your current page to another servlet or jsp page. This method is used …
How To Display Your System Font Families in Java
This tutorial highlights the API for displaying the list of font families available in your system using Java. You can get the font families using getAvailableFontFamilyNames() method of the local GraphicsEnvironment. The GraphicsEnvironment class describes the collection of GraphicsDevice objects and Font objects available to a Java(tm) application on a particular platform. Lets look at the example: FontListExample.java Output…
Request Dispatcher In Servlet
Java EE Tutorials Servlets Tutorials Servlets Interview Questions Request Dispatcher While developing web applications we need to distribute the request processing and response generation to multiple servlet objects. So we need to dispatch requests from one component to another component. This can be done by using RequestDispatcher interface. RequestDispatcher interface is implemented by servlet container …