Hindustan Unilever Limited JavaEE experienced interview questions
Hindustan Unilever Limited
JavaEE
Interview Question for
Experienced Professinal
What is the difference between Interface and
Abstract class?
Abstract class
|
Interface
|
class extends only one abstract class
|
Class can extends many interfaces
|
Abstract can have
non abstract methods
|
All
methods of interface
is abstract type.
|
Abstract class can have all
access modifiers .
|
In interface public modifiers
|
Abstract classes are
for design suitable
|
Interface for implementation .
|
What are the different ways to handle
exceptions?
Ans :
There are two ways
to handle the exceptions 1.
wrapping the code in to try
catch and finally block.
2. Throwing method
generated exception using throws
keyword
What is the use of Wrapper class?
Ans: A Wrapper
class is a class whose object
wraps or contains a primitive data types. When we create an object to a wrapper
class, it contains a field and in this
field, we can store a primitive data
types. In other words, we can wrap a
primitive value into a wrapper class
object.
Difference between string literal and string
object?
Ans -
String literals are when we
declare string directly . But
string object declare
using new keyword .
String st = new
String “Mukesh” ;
String str=new String (“Mukesh”);
Object slower then literal in executions
Tell about Map interface?
Ans— Map is collection interface . Stores elements as key and value pair .
Map can have one Null
key and multiple null value.
What is synchronization?
Ans -
Synchronisation is
technique to access
one object by
multiple Thread at a
time .
This can be achieve
using lock the object .
What is the purpose of finalization?
Ans -
Finalisation is method
for garbage collection . This method
is call for garbage
collection .
What is autowiring in Spring?
Ans- Autowiring
is used to call
one bean in to another bean . @autowire annotation
is used for this purpose . Auto wiring
are type none ,
byname , by type .
List the
different Scopes of Spring bean?
Ans-
Singleton , prototype request ,
session , global session
What is the use of AOP?
Ans - AOP
stats Aspect oriented programming .
This useful when we need to
big source code
into small modules.
What is the DispatcherServlet?
Ans DispatcherServlet is
servlet which use
as front controller .
DispatcherServlet
take the spring request and contact
Handler Mapper , then contact controller and
filly
view resolver to give
response of the request .
Difference between GET and POST?
GET
|
POST
|
GET
is not vary secure to
send the data in browser
|
Post
is secure to send the data.
|
Can be bookmarked
|
Can’t be bookmarked
|
Can cashed
|
Can't be cashed
|
What is Hibernate Caching?
Ans -
Hibernate cashing is technique
to prevent repetitive
hit of the data table.
two type of cashing
hibernate provide
1. First level cash (session
level )
2. Second level cash .
What is named Query?
Ans-The hibernate named query is way to use any
query by some meaningful name. It is like using alias names. The Hibernate
framework provides the concept of named queries so that application programmer
need not to scatter queries to all the java code.
What is HQL?
Ans -
Hibernate Query Language (HQL) is an object-oriented query language,
similar to SQL, but instead of operating on tables and columns, HQL works with
persistent objects and their properties. HQL queries are translated by
Hibernate into conventional SQL queries, which in turns perform action on
database.
What is inner join?
Ans-The INNER JOIN selects all rows from both
participating tables as long as there is a match between the columns. An SQL
INNER JOIN is same as JOIN clause, combining rows from two or more tables.
SELECT *
FROM table1 INNER JOIN table2
ON table1.column_name = table2.column_name;
How to invoke stored procedure from java?
Ans - Store procedure is
called using
CallableStatement in Java .
this is sample of the code we can use for that
CallableStatement cstmt = null;
try {
String
SQL = "{call getEmpName (?, ?)}";
cstmt =
conn.prepareCall (SQL);
. . .
}
catch (SQLException e)
{
. . .
}
finally {
. . .
}
How to handle PL/SQL exceptions?
Ans —
The PL/SQL handles
used when and
then key word to handle
exception . Here
it is a
sample of the code.
DECLARE
<declarations section>
BEGIN
<executable command(s)>
EXCEPTION
<exception handling goes here >
WHEN exception1 THEN
exception1-handling-statements
WHEN exception2 THEN
exception2-handling-statements
WHEN exception3 THEN
exception3-handling-statements
........
WHEN
others THEN
exception3-handling-statements
END;
What is Sequence?
Ans:—
Sequence is a feature supported by some database
systems to produce unique values on demand. Some DBMS like MySQL supports
AUTO_INCREMENT in place of Sequence.
Sequence can represent a row
uniquely.
Tell about basic JUnit annotations?
Ans-::
Here are basic annotations used in the JUnit .
@BeforeClass – Run once before any of the test
methods in the class, public static void.
@AfterClass – Run once after all the tests in
the class have been run, public static void.
@Before – Run before @Test, public void.
@After – Run after @Test, public void.
@Test -
Hindustan Unilever Limited JavaEE experienced interview questions
Reviewed by Mukesh Jha
on
9:33 AM
Rating:

No comments:
Add your comment