Owner: javainterviewquestions URL:http://www.bestjavainterviewquestions.com/ Join Date: Fri, 20 Jun 2008 20:52:13 -0500 Rating:0 Site Description: This site will give all the relavent and important information which can help u in the interview point of view Site statistics:Click here
Java Multi-Thread Questions 2008-07-01 10:10:59 Multi-threaded design questions
Q) Do I need to use synchronized on setValue(int)?
A) It depends whether the method affects method local variables, class static or instance variables. If only method local variables are changed, the value is said to be confined by the method and is not prone to threading issues.
Q) Do I need to use [...] Read more:Multi
, Thread
Java Thread Questions 2008-06-30 22:08:37 THREADS INTERVIEW QUESTIONS AND ANSWERS JAVA
Q) What is threaded programming and when is it used?
A) Thread
ed programming is normally used when a program is required to do more than one task at the same time. Threading is often used in applications with graphical user interfaces; a new thread may be created to do some processor-intensive [...]
Java Thread Interview Questions 2008-06-30 21:57:33 THREADS INTERVIEW QUESTIONS AND ANSWERS JAVA
Q) What are the two types of multitasking ?
A) a. Process-based.
b. Thread
-based.
Q) What is a Thread ?
A) A thread is a single sequential flow of control within a program.
Q) What are the two ways to create a new thread?
A) a.Extend the Thread class and override the run() method.
b.Implement the Runnable [...]
Java Exception Handling Questions 2008-06-30 12:50:12 JAVA EXCEPTION HANDLING INTERVIEW QUESTIONS AND ANSWERS
Q) What package contains exception handling related classes?
A) java.lang
Q) what ar the two types of Exceptions?
A) Checked Exceptions and Unchecked Exceptions
Q) What is the base class of all Exceptions?
A) java.lang.Throwable.
Q) What is difference between an Exception and Error in java?
A) Exception and Error are the subclasses of the Thr Read more:Handling
Jdbc Interview Questions 2008-06-25 14:26:39 Q) What are the steps involved in establishing a JDBC connection?
A) This action involves two steps: loading the JDBC driver and making the connection.
Q) How can you load the drivers?
A) Loading the driver or drivers you want to use is very simple and involves just one line of code. If, for example, you want to [...]
Jdbc Interview Questions 2008-06-25 14:15:14 Q) Is java.sql.Driver a class or an Interface ?
A) It’s an interface.
Q) Is java.sql.DriverManager a class or an Interface ?
A) It’s a class. This class provides the static getConnection method, through which the database connection is obtained.
Q) Is java.sql.Connection a class or an Interface ?
A) java.sql.Connection is an interface. The implmentation is provided by [...]
JDBC Questions 2008-06-24 21:40:08 Q) What is JDBC?
A) JDBC is a layer of abstraction that allows users to choose between databases. It allows you to change to a different database engine and to write to a single API. JDBC allows you to write database applications in Java without having to concern yourself with the underlying details [...]
Java-Jdbc Questions 2008-06-24 11:59:48 Q) What’s the JDBC 3.0 API?
A) The JDBC 3.0 API is the latest update of the JDBC API. It contains many features, including scrollable result sets and the SQL:1999 data types.
Q) Does the JDBC-ODBC Bridge support the new features in the JDBC 3.0 API?
A) The JDBC-ODBC Bridge provides a limited subset of the [...]
JAVA UTIL PACKAGE 2008-06-23 12:34:20 JAVA COLLECTIONS INTERVIEW QUESTIONS AND ANSWERS
1) Explain Java Collections Framework?
A) Java Collections Framework provides a well designed set of interfaces and classes that support operations on a collection of objects.
2) Explain Iterator Interface.
A) An Iterator is similar to the Enumeration interface. With the Iterator interface methods, you can traverse a collection from start to [...]
Java Basic Questions 2008-06-23 12:06:12 Q. Can you help me debug my program?
A. If the problem you are having is not directly related to our software, we suggest that you use a Java development tool that helps you with debugging, and that you invest in some books or training to help you learn Java. There are many ways to [...] Read more:Basic
Springs Interview Questions 2008-07-15 14:01:25 Q) What are the types of Advice?
A) Types of advice:
–> Before advice: Advice that executes before a join point, but which does not have the ability to prevent execution flow proceeding to the join point (unless it throws an exception).
–> After returning advice: Advice to be executed after a join point completes normally: [...] Read more:Springs
Springs Interview Questions 2008-07-15 13:52:22 Q) What is DelegatingVariableResolver?
A) Spring provides a custom JavaServer Faces VariableResolver implementation that extends the standard Java Server Faces managed beans mechanism which lets you use JSF and Spring together. This variable resolver is called as DelegatingVariableResolver
Q) How to integrate Java Server Faces (JSF) with Spring?
A) JSF and Spring do share some of [...] Read more:Springs
Springs Interview Questions 2008-07-15 13:48:21 Q) What is IOC (or Dependency Injection)?
A) The basic concept of the Inversion of Control pattern (also known as dependency injection) is that you do not create your objects but describe how they should be created. You don’t directly connect your components and services together in code but describe which services are needed by [...] Read more:Springs
Hibernate Interview Questions 2008-07-12 13:08:38 Q) What are the most common methods of Hibernate
configuration?
A) The most common methods of Hibernate configuration are:
* Programmatic configuration
* XML configuration (hibernate.cfg.xml)
Q) What are the important tags of hibernate.cfg.xml?
A) An Action Class is an adapter between the contents of an incoming HTTP rest and the corresponding business logic that should be executed to process [..
Hibernate Interview Questions 2008-07-12 11:10:03 Q) What is Hibernate
?
A) Hibernate is a powerful, high performance object/relational persistence and query service. This lets the users to develop persistent classes following object-oriented principles such as association, inheritance, polymorphism, composition, and collections.
Q) What is ORM?
A) ORM stands for Object/Relational mapping. It is the programmed and translucent perseverance of objec
Servlet important questions 2008-07-07 12:21:25 Q) What is the servlet?
A) Servlets are modules that extend request/response-oriented servers, such as Java-enabled web servers. For example, a servlet might be responsible for taking data in an HTML order-entry form and applying the business logic used to update a company’s order database.
Servlets are to servers what applets are to browsers. Unlike applets, however, [...] Read more:questions
STRUTS Interview Questions 2008-07-07 12:14:25 Q) What is the advantage of DispatchAction class?
A) Using DispatchAction class you can overcome writing one Action class for one business entity. Instead you can write multiple business entities in one Action class and call the business method that is required by the application.
Q) Can you write your own method in Action class other than [...]
JSP Standard Questions 2008-07-07 12:01:34 Q) Can I invoke a JSP error page from a servlet?
A) Yes, you can invoke the JSP error page and pass the exception object to it from within a servlet. The trick is to create a request dispatcher for the JSP error page, and pass the exception object as a javax.servlet.jsp.jspException request attribute. However, note [...] Read more:Standard
JSP Interview Questions 2008-07-07 11:54:42 Q) What is the difference between ServletContext and PageContext?
A) ServletContext: Gives the information about the container
PageContext: Gives the information about the Request
Q) What is the difference in using request.getRequestDispatcher() and context.getRequestDispatcher()?
A) request.getRequestDispatcher(path): In order to create it we need to give the relative path of the resource.
JMS INTERVIEW QUESTIONS 2008-07-07 11:08:09 JMS INTERVIEW QUESTIONS AND ANSWERS
Q) What is Messaging?
A) Messaging is a method of communication between software components or applications
Q) What is JMS?
A) Java Message Service is a Java API that allows applications to create, send, receive, and read messages.
Q) Is JMS a specification or a product?
A) JMS is a specification.
Q) What are the features [...]
JSF Important Questions 2008-07-24 13:41:25 Q) How to show Confirmation Dialog when user Click the Command Link?
A)
h:commandLink assign the onclick attribute for internal use. So, you cannot use it to write your own code. This problem will fixed in the JSF 1.2. For the current JSF version you can use onmousedown event that occurs before onclick.
<script language=”javascript”> function ConfirmDelete(link) [...]
JSF Important Interview Questions 2008-07-24 13:19:40 Q) How to get current page URL from backing bean?
A) You can get a reference to the HTTP request object via FacesContext like this:
FacesContext fc = FacesContext.getCurrentInstance();
HttpServletRequest request = (HttpServletRequest) fc.getExternalContext().getRequest();
and then use the normal request methods to obtain path information. Alternatively,
context.getViewRoot().getViewId();
will ret
JSF Interview Questions 2008-07-24 12:21:29 Q) What are the different kinds of Bean Scopes in JSF?
A) JSF supports three Bean Scopes. viz.,
Request Scope: The request scope is short-lived. It starts when an HTTP request is submitted and ends when the response is sent back to the client.
Session Scope: The session scope persists from the time that a session is [...]
JSF Interview Questions 2008-07-24 11:44:55 Q) What are the differences between a Backing Bean and Managed Bean?
A) Backing Beans are merely a convention, a subtype of JSF Managed Beans which have a very particular purpose. There is nothing special in a Backing Bean that makes it different from any other managed bean apart from its usage.
What makes a Backing Bean [...]
JSF Interview Questions 2008-07-24 11:12:19 Q) What is JSF (or JavaServer Faces)?
A) A server side user interface component framework for Java technology-based web applications.JavaServer Faces (JSF) is an industry standard and a framework for building component-based user interfaces for web applications. JSF contains an API for representing UI components and managing their state; handling events, server-side validation, and data conversion
Java Swings Interview Questions 2008-07-21 12:23:26 Q) In which package are most of the AWT events that support the event-delegation model defined?
A) Most of the AWT-related events of the event-delegation model are defined in the java.awt.event package. The AWTEvent class is defined in the java.awt package.
Q) Which class is the immediate superclass of the MenuComponent class?
A) Object
Q) Which containers may have [...]
Swings Interview Questions 2008-07-21 12:21:21 Q) What is the difference between a Choice and a List?
A) A Choice is displayed in a compact form that requires you to pull it down to see the list of available choices. Only one item may be selected from a Choice. A List may be displayed in such a way that several List items [...]
Java Swings Interview Questions 2008-07-21 12:00:33 Q) Can a class be it’s own event handler? Explain how to implement this.
A: Sure. an example could be a class that extends Jbutton and implements ActionListener. In the actionPerformed method, put the code to perform when the button is pressed.
Q) Why does JComponent have add() and remove() methods but Component does not?
A: because JComponent [...]
Session Tracking Example using Servlets 2008-09-08 13:29:17 Sessions in Servlets
The following examples show the newer session tracking API in use within Servlets.
The first time a user runs the “Barman” servlet, it sets up a session for him and prompts for his name. On subsequent visits, it addresses him by name straight away, and also keeps a tally of how many times he’s [...] Read more:Tracking
, Example
Servlets Session Examples 2008-09-08 13:19:35 Servlet Session Example
/*
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the “License”);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* -2.0
*
* Unless required [...] Read more:Examples