ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories >> Software >> Java-Related >> Java-J2EE >> Java-J2EE-AllOther
 
 


 

Back to Questions Page
 
Question
What is need of DAO? Write one simple DAO example?
Rank Answer Posted By  
 Question Submitted By :: Sreenivas.lsvr
This Interview Question Asked @   IBM
I also faced this Question!!   © ALL Interview .com
Answer
DAO: Data Access Object. here the main concept of DAO is to 
communicate with the database. DAO mainly contains 
1.) DAOFactory: this specifies which kind of database
(wether MySQL or ORACLE or MSSQL etc...).

2.) SQLFactory: which extends the DAOFactory. Here we do 
all the connection stuffs.deciding te driver, hostname, 
URL, username, password etc and also getting the Connection 
object.

3.) AdminDAO: this is a interface where we declare all the 
methods which we need in our application to perform all the 
database related operation.

4.) SQLAdminFactory: this implements the AdminDAO 
interface, all its method. this also gets the connection 
from SQLFactory.

5.) TransactionControlDAO: here we keep the commit and 
roolback methods.

if required...
6) ConnectionConstant: in this file we can mention the file 
name (.properties file) where we keep the connection 
detals, like hostname, username, password, etc...
 
0
Naveen Kumar V
 
 
Question
What is the use of log4j and how to make use of
that in a application?
Rank Answer Posted By  
 Question Submitted By :: Mahender
I also faced this Question!!   © ALL Interview .com
Answer
log4j can be used for writing the log messages to various 
kinds of destinations like a file, database, console etc...

It is always advisable to use some sort of logging API to 
generate the log messages.the log messages helps the end 
user as well as the developer of the application, to kow 
about what the application has done and why the application 
has failed, etc...

It is developed by Apache and this is used as part of 
various products like hibernate, struts, strings etc...
 
0
Suresh Gangula
 
 
Question
what is difference between vector and arraylist?.
Rank Answer Posted By  
 Question Submitted By :: Guest
This Interview Question Asked @   HCL , C-DAC
I also faced this Question!!   © ALL Interview .com
Answer
vector is synchronized . collection object and variable 
slow acess. muntable
array list is never snchronized. collection variable fast 
acess
 
0
Guest
 
 
 
Answer
Vector is synchronized and compare to array list this slow 
access, by defaulst the vector is 10,this is legacy class 
Where as arraylist is unsynchronized and fast random 
access,in arraylist there is no default size automatically 
it is growable once the object is created it will be 
allocated,this is advanced class.
 
0
Srinivas
 
 
Question
httt method
Rank Answer Posted By  
 Question Submitted By :: Guest
This Interview Question Asked @   HCL
I also faced this Question!!   © ALL Interview .com
Answer
doget,dopost,doput,dohead,dooption,dodelete,dotrace
doget method default method.
 
2
Guest
 
 
Question
What is a constructor?
Rank Answer Posted By  
 Question Submitted By :: Saru
I also faced this Question!!   © ALL Interview .com
Answer
A constructor is one which is used to initialize the 
instance variables of an object.
 
0
Suma
 
 
Answer
Guarrented intilization of instance variables of an object.
 
0
Srinivasa Reddy
 
 
Question
which book is the best for preparing for SCWCD 1.5
Rank Answer Posted By  
 Question Submitted By :: Deepa
This Interview Question Asked @   Google
I also faced this Question!!   © ALL Interview .com
Answer
SCWCD1.5 by Kathy Sierra is the Best Book
 
3
Anilraju
 
 
Answer
Head First Servlets & JSP
 
0
Vaibhav
 
 
Question
what is the difference between banking and insurance domain?
Rank Answer Posted By  
 Question Submitted By :: Nanunimavane@gmail.com
I also faced this Question!!   © ALL Interview .com
Answer
vary  simple   answer is  in banking domain   you 
   to intracts with customers  to manage their  accounts
   safty  of their money ,easiy transation 
methods ,management  of diffrent barach  account , all 
possible  way  transation like electronic transations etc , 
 report  to client transation  , Recovery of any flase 
transation . And security of infornation ..

          while  in  insurance domain  any company define
      their polocy  and plan  customer invest their money .
      customer  gets benefit accoding to their paln .but 
      in case any accident and injury . customer claims to 
      insurance company for their  benefit .(now claim shold
       be in differnt mode this accoding to software 
requirements   of the clients ). On  the basis of their  
claim compny provides benefit . otherwise customer can make
 case to laws of country  against the company . 
                        There are so many type of insurance 
    are there . . .  
                    i hope  you get your answer  or contact
                                       mukesh 9242713864.
 
0
Mukesh
 
 
Question
How to implement or use the singleton class in java?
Rank Answer Posted By  
 Question Submitted By :: Ragini3
I also faced this Question!!   © ALL Interview .com
Answer
A singleton is an object that cannot be instantiated. At
first, that might seem counterintuitive - after all, we need
an instance of an object before we can use it. Well yes a
singleton can be created, but it can't be instantiated by
developers - meaning that the singleton class has control
over how it is created. The restriction on the singleton is
that there can be only one instance of a singleton created
by the Java Virtual Machine (JVM) - by prevent direct
instantiation we can ensure that developers don't create a
second copy.

We'll start with the class definition, for a SingletonObject
class. Next, we provide a default constructor that is marked
as private. No actual code needs to be written, but you're
free to add some initialization code if you'd like. 

public class SingletonObject
{
	private SingletonObject()
	{
		// no code req'd
	}
}

So far so good. But unless we add some further code,
there'll be absolutely no way to use the class. We want to
prevent direct instantiation, but we still need to allow a
way to get a reference to an instance of the singleton object.
 
0
Pinaki Mukherjee
 
 
Answer
singleton is a design pattern. in this per application only 
one object should exist.we implement it as follows:

public class abcd
{
private static abcd instance=null;
protected abcd()
{
//only to defeat instantiation;
}
public static abcd getInstance()
{
if(instance==null)
{
instance=new abcd();
}
return instance;
}
 
0
Amit Sharma
[Venqcorp]
 
 
Question
Is it possible to create Userdefined Unchecked Exception
also?If Yes, give an example?
Rank Answer Posted By  
 Question Submitted By :: Shiva034
I also faced this Question!!   © ALL Interview .com
Answer
Yes,

public class UnCheckedExceptionExam extends RuntimeException
{

public UnCheckedExceptionExam(){
System.out.println("No argument");
}
public UnCheckedExceptionExam(String message){
System.out.println(message);
System.out.println(initCause(new Throwable("define 
exception")));
}
public UnCheckedExceptionExam(Throwable cause){
System.out.println(cause.getCause());
}
public UnCheckedExceptionExam(String message,Throwable 
cause){
System.out.println(message);
System.out.println(cause.getCause());

}
}
 
0
Chinna
 
 
Question
whatis arguments &what is default argument
Rank Answer Posted By  
 Question Submitted By :: Guest
This Interview Question Asked @   CTS
I also faced this Question!!   © ALL Interview .com
Answer
Arguments are passed to parameters. Arguments are should
have some values, but parameters are declared in the
function, its only declaring the variables.

Default arguments depends on corresponding parameters.
 
0
Sreenivas.lsvr
 
 
 
Back to Questions Page
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com