Category Archives: Java

Basic Java interview questions

What is a Marker Interface? - An interface with no methods. Example: Serializable, Remote, Cloneable
What interface do you implement to do the sorting? - Comparable
What is the eligibility for a object to get cloned? - It must implement the Cloneable interface

Posted in Java | 5 Comments

J2EE EJB interview questions

What is the relationship between local interfaces and container-managed relationships? - Entity beans that have container-managed relationships with other entity beans, must be accessed in the same local scope as those related beans, and therefore typically provide a local client view. In order to be the target of a container-managed relationship, an entity bean with [...]

Also posted in Networking | 7 Comments

J2EE with EJB and Weblogic interview questions

What is the difference between URL instance and URLConnection instance? - A URL instance represents the location of a resource, and a URLConnection instance represents a link for accessing or communicating with the resource at the location.
What are the two important TCP Socket classes? - Socket and ServerSocket. ServerSocket is used for normal two-way socket [...]

Posted in Java | Leave a comment

Interview questions for Java junior developer position

What gives Java its “write once and run anywhere” nature? - Java is compiled to be a byte code which is the intermediate language between source code and machine code. This byte code is not platorm specific and hence can be fed to any platform. After being fed to the JVM, which is specific to [...]

Posted in Java | 6 Comments

Java database interview questions and answers

How do you call a Stored Procedure from JDBC? - The first step is to create a CallableStatement object. As with Statement and PreparedStatement objects, this is done with an open Connection object. A CallableStatement object contains a call to a stored procedure.

CallableStatement cs =
con.prepareCall("{call SHOW_SUPPLIERS}");
ResultSet rs = cs.executeQuery();

Also posted in Database | 8 Comments

Java Messaging System interview questions

What are the types of messaging? - There are two kinds of Messaging. Synchronous messaging involves a client that waits for the server to respond to a message. Asynchronous messaging involves a client that does not wait for a message from the server. An event is used to trigger a message from a server.
What is [...]

Posted in Java | Leave a comment

Common JSP interview questions

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.
Is JSP technology extensible? - Yes. JSP technology is extensible through the development of custom actions, or [...]

Also posted in Networking | 9 Comments

Java interview questions and answers

What is the Collections API? - The Collections API is a set of classes and interfaces that support operations on collections of objects
What is the List interface? - The List interface provides support for ordered collections of objects.

Posted in Java | 4 Comments

Java GUI designer interview questions

What advantage do Java’s layout managers provide over traditional windowing systems? - Java uses layout managers to lay out components in a consistent manner across all windowing platforms. Since Java’s layout managers aren’t tied to absolute sizing and positioning, they are able to accomodate platform-specific differences among windowing systems.
What is the difference between the paint() [...]

Posted in Java | 2 Comments

J2EE interview questions and answers

Thanks to Sachin Rastogi for contributing these.

What makes J2EE suitable for distributed multitiered Applications?
- The J2EE platform uses a multitiered distributed application model. Application logic is divided into components according to function, and the various application components that make up a J2EE application are installed on different machines depending on the tier in the multitiered [...]

Posted in Java | 5 Comments

Basic Java servlet interview questions

What is the difference between CGI and Servlet?
What is meant by a servlet?

Posted in Java | 16 Comments

Java AWT interview questions

Thanks to Sachin Rastogi for contributing these.

What is meant by Controls and what are different types of controls? - Controls are componenets that allow a user to interact with your application. The AWT supports the following types of controls:

Labels
Push buttons
Check boxes
Choice lists
Lists
Scroll bars
Text components

These controls are subclasses of Component.

Posted in Java | Leave a comment