Saturday 26 November 2011

Java/Struts interview questions: - All types of Action classes in Struts.

One of the most likely questions asked in  Java/Struts interview questions. So set your answers accordingly as mentioned below.
  • ForwardAction: to do the “forward-only” and allow you to access the specified JSP page directly without going through controller.
  • IncludeAction: IncludeAction is much like ForwardAction except that the resulting resource is included in the HTTP response instead of being forwarded to
  • DispatchAction: provides a mechanism for grouping a set of related functions into a single action, thus eliminating the need to create separate actions for each functions.
  • LookupDispatchAction: provides a mechanism for grouping a set of related functions into a single action.
  • SwitchAction: This is a standard Action that switches to a new module and then forwards control to a URI within the new module.
  • DownloadAction: This is an abstract base class that minimizes the amount of special coding that needs to be written to download a file.
  • LocaleAction: Implementation of Action that changes the user's Locale and forwards to a page, based on request level parameters that are set.
  • EventDispatchAction: An Action that dispatches to to one of the public methods that are named in the parameter attribute of the corresponding ActionMapping and matches a submission parameter.
  • MappingDispatchAction: Same with Dispatch Action, group similar functionality into a single action class but with different mechanism.
  • DynoAction: Allow you to create a virtual form bean declaratively to increase the development speed.
View the following video on understanding the basics introduction to Struts: -



Click and get to see more on Java/Struts interview questions series.

Regards,

Also visit author’s blog for more Java/Struts interview questions

Sunday 20 November 2011

Java interview questions: - 14 important questions asked on String Handling.

During interview following are  Java interview questions which is asked by the interviewer. So do prepare for the interview on this 14 important questions: -
  • Is String a primitive data type in Java?
  • What is the difference between String and String Buffer?
  • Which gives more perform String or StringBuffer?
  • What is difference between string and StringTokenizer?
  • Which package does define String and StringBuffer classes?
  • Which method can be used to obtain the length of the String?
  • How do you concatenate Strings?
  • Which method can be used to compare two strings for equality?
  • Which method can be used to perform a comparison between strings that ignores case differences?
  • What is the use of valueOf( ) method?
  • What are the uses of toLowerCase( ) and toUpperCase( ) methods?
  • Which method can be used to find out the total allocated capacity of a StrinBuffer?
  • Which method can be used to set the length of the buffer within a StringBuffer object?
  • What is StringBuilder?
View the following video on tiles integration with Struts 2: -



Visit for more  Java/J2EE interview questions series.
Regards,

Also visit author’s blog for more Java/J2EE interview questions

Friday 18 November 2011

Java interview questions: - 16 most asked important questions on Input and Output (I/O).

Following are the sets of 16 most asked  Java interview questions by the interviewer during the interview.
  • What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?
  • What is the purpose of the File class?
  • What an I/O filter?
  • What is the difference between the File and RandomAccessFile classes?
  • What is Serialization and deserialization?
  • What is the difference between Serializalble and Externalizable interface?
  • Which methods of Serializable interface should I implement?
  • What is the purpose of the Runtime class?
  • What is the purpose of the System class?
  • What is the Properties class?
  • How many methods in the Externalizable interface?
  • What class allows you to read objects directly from a stream?
  • What happens to the static fields of a class during serialization?
  • How do I connect a Reader to an InputStream?
  • How many types of IOStream are present?
  • What is the use of non blocking IO?
Also see the following interesting video on Inheritance between beans and Spring: -

Know more on  Java interview questions
Regards,
Get more on Java interview questions from author’s blog

Tuesday 15 November 2011

Java/servlets interview questions: - Session tracking and methods for session tracking.

This is one of the asked Java/J2EE interview questions during an interview. So one can start proceeding with the answer as follows.

Session tracking is a mechanism that servlets use to maintain state about a series requests from the same user across some period of time

Following are the methods for session tracking: -
  • User Authentication - occurs when a web server restricts access to some of its resources to only those clients that log in using a recognized username and password.
  • Hidden form fields - fields are added to a HTML form which is not displayed in the client’s browser. When the form containing the fields is submitted, the fields are    sent back to the server.
  • URL rewriting - every URL that the user clicks on is dynamically modified or rewritten to include extra information. The extra information can be in the form of extra path information, added parameters or some custom, server-specific URL change.
  • Cookies - a bit of information that is sent by a web server to a browser and which can later be read back from that browser.
  • HttpSession- places a limit on the number of sessions that can exist in memory.

See the following video on Value List Handler as follows: -



Click and get to see more on  Java/J2EE interview questions series.

Regards,

Also visit author’s blog for more Java/J2EE interview questions

Saturday 12 November 2011

Java interview questions: - What are the functions present in Queue interface?

This is one of the typically asked  Java interview questions in most of the Java interview.
  • public boolean offer(Object element): return false if the object cannot be added to the collection due to size issue and without throwing unchecked exception.
  • public Object remove(): behaves like the Collection interface version.
  • public Object poll(): behaves just like remove() but when invoked on empty collection returns null without throwing exception.
  • public Object element(): for querying the element at the head of the queue. Throws exception when a collection is empty.
  • public Object peek(): for querying the element at the head of the queue. Returns null if the collection is empty.
Also see Batch Processing video in Hibernate of  Java interview questions



Visit for more  Java/J2EE interview questions series.

Regards,

Also visit author’s blog for more Java/J2EE interview questions

Thursday 10 November 2011

Java/J2EE interview questions: - Explanation of working thread .

One can start answering this Java/J2EE interview questions as follows: -
  • In working thread scheme, allocates one thread to execute one task.
  • When the task is complete, the thread may return to a thread pool for later use. In this scheme a thread may execute arbitrary tasks, which are passed in the form of a Runnable method argument, typically execute().
  • The runnable tasks are usually stored in a queue until a thread host is available to run them.
  • The worker thread design pattern is usually used to handle many concurrent tasks where it is not important which finishes first and no single task needs to be coordinated with another. The task queue controls how many threads run concurrently to improve the overall performance of the system. However, a worker thread framework requires relatively complex programming to set up, so should not be used where simpler threading techniques can achieve similar results.
View the following video on tiles integration with Struts 2: -



Know more on Java interview questions

Regards,

Get more on Java interview questions from author’s blog

Tuesday 8 November 2011

Java interview questions: - Mention differences between Enumeration, ArrayList, Hashtable, Collections and Collection.

Following is the differences between Enumeration, ArrayList, Hashtable, Collections and Collection for the Java interview questions asked by the interviewer.
  • Enumeration: It is series of elements. It can be use to enumerate through the elements of a vector, keys or values of a hashtable. Used for read only operations on collections.
  •  ArrayList: It is re-sizable array implementation. Implements List interface It permits all elements, including null. It is not thread -safe.
  •  Hashtable: It maps key to value. You can use non-null value for key or value. It is part of group Map in collection.
  •  Collections: It implements Polymorphic algorithms which operate on collections.
  •  Collection: It is the root interface in the collection hierarchy.
See the following video which will show us practically Inheritance between beans and Spring: -



Visit for more  Java interview questions

Regards,

Also visit for more author’s blog on Java interview questions

Saturday 5 November 2011

Java interview questions: - Describe JDBC and steps involved in the JDBC connection.

A widely asked  Java interview questions in most of the Java interview.

So one can start the answer as follows: -

Definition: -


JDBC is a set of Java API for executing SQL statements. This API consists of a set of classes and interfaces to enable programs to write pure Java Database applications

Steps in the JDBC connection: -

Step 1: Register the database driver by using:
Class.forName(\" driver class for that specific database\" );

Step 2: Now create a database connection using:
Connection con = DriverManager.getConnection(url,username,password);

Step 3: Now create a query using:
Statement stmt = Connection.Statement(\"select * from TABLE NAME\");

Step 4: Execute the query:
stmt.exceuteUpdate();

Also see the following video on Java Builder Design Pattern as follows: -



Know more on  Java interview questions

Regards,


Get more on Java interview questions from author’s blog.

Wednesday 2 November 2011

21 important Java/J2EE interview questions

This following part will cover the most asked Java/J2EE interview questions during Java/J2EE interview.

So have a look on the same and do revise it when ever you go for the Java/J2EE interview questions  interview.

Normally the Java’s interviewer starts with.....
  • What is the difference among JVM Spec, JVM Implementation, JVM Runtime?
  • What are JDK and JRE?
  • What is JIT?
  • What is a JVM heap?
  • What is sandbox?
  • What is Locale? 
  • What is a ResourceBundle class?
  • How will you get the platform dependent values like line separator, path separator? 
  • How does garbage collector decide which objects are to be removed? Can garbage collector be forced?
  • What is the final keyword denotes w.r.t class, method and variable?
  • What are the methods in Object? 
  • Can you instantiate the Math class?
  • What is the difference between the instanceof and getclass, these two are same or not?
  • Can main method be declared final? 
  • What is a native method?
  • Does Java provide any construct to find out the size of an object?
  • Is Empty .java file a valid source file?
  • Can a .java file contain more than one java classes?
  • What is the difference between an argument and a parameter?
  • What are the different scopes for Java variables? 
  • What are wrapper classes?
Also see the following video on on FlyWeight Pattern which will help you to boost your interview preparation: -




Get more study materials on Java/J2EE interview questions

Regards,

See for more author’s other blog on Java/J2EE interview questions