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
 
  J2ME (99)  Java-Related-AllOther (21)
 


 

Back to Questions Page
 
Question
How do you maintain a stateful session object across the 
session
Rank Answer Posted By  
 Question Submitted By :: Rama
This Interview Question Asked @   HCL
I also faced this Question!!   © ALL Interview .com
Answer
Stateful session object across session may be maintained 
through session tracking techniques :
1)Cookies
2)URL rewriting
3)Session Variables
4)HttpSession
 
0
Sangeetta
 
 
Answer
Stateful session object across the session may be maintained
through :

1. Hidden fields
2. Cookies
3. Http Session Object
      a) Session managed using Cookies
      b) Session managed using URL-reWriting technique.
 
0
Balaji
 
 
Question
Iam working as  a Project Lead in a s/w comp.The follwing 
question was asked in HCL interview.
What about the schedule slippage?  If the developer has 
taken more time than the specified time.  How do you adjust 
the time?  From where do you allocate that extra time for 
the developer?
Rank Answer Posted By  
 Question Submitted By :: Sankar.yadavalli
This Interview Question Asked @   HCL
I also faced this Question!!   © ALL Interview .com
Answer
schedule slippage is nothing but slip the schedule 
ex:if u want to do some work with in time ,but u did not 
   complete in time that is .
                 extra time is allocate denpends upon the 
   request ,company ,time etc.
 
0
Pkr_reddy
 
 
 
Answer
schedule slippage is nothing but slip the schedule 
if a person havent done the work in assigned time for
him,then it is called as scheduled slippage.for that he/she
has to ask company for an extra time with an assurance but
this is anyhow a demerit of that employee by slipping the
scheduled time.
 
0
Madanreddy
 
 
Question
What are all the documents have you involved in preparation 
of a Project as a Project Lead?
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
Program specification documents,functional specification 
document,Esitimate the time duration for the project,class 
diagram,etc..
 
0
Guest
 
 
Question
Can we write the Remote and Local Interfaces in one Bean.  
How do you define it in the deployment descriptor.
Rank Answer Posted By  
 Question Submitted By :: Harish
This Interview Question Asked @   HCL
I also faced this Question!!   © ALL Interview .com
Answer
Local Interfaces can?t be accessed outside the world.  
Those interfaces can be accessed by the entity which are in 
the same EJB Container.  Using which you can reduce the 
network traffic.
 
0
Harish
 
 
Answer
yes.we define the deployement descriptor to mention the two 
beans.
 
0
Sathish Babu
 
 
Question
How do you implement the Local Interfaces ?
Rank Answer Posted By  
 Question Submitted By :: Harish
This Interview Question Asked @   HCL
I also faced this Question!!   © ALL Interview .com
Answer
EJBLocalObject, EJBLocalHome, EntityBean.
 
0
Harish
 
 
Question
How do you pass the data from one servlet to another 
servlet?
Rank Answer Posted By  
 Question Submitted By :: Harish
This Interview Question Asked @   HCL , Hcl, How Do We Add Two Integer Values In Servlet And Displaying Another Html's Text Box?
I also faced this Question!!   © ALL Interview .com
Answer
Using Request Dispatcher, you can send the values and 
forward to another page.
ServletContext.getRequestDispatcher();
reqDispatcher.forward(req,res)
Forwards a request from a servlet to another resource 
(servlet, JSP file, or HTML file) on the server.
reqDispatcher.include(req,res)
Includes the content of a resource (servlet, JSP page, HTML 
file) in the response.
 
0
Harish
 
 
Answer
We can pass the data from one servlet to another using 
RequestDispatcher object.


1.RequestDispatcher rd=getServletContext.getNamedDispatcher
("...");
rd.forward(request,response);

... means use the name of the url-patterns you have 
specified for the servlet in web.xml.
 
0
Tulasi Vani
 
 
Answer
also we can set data in the request too

request.setAttribute("variableName"object);

we can get the value in the next servlet by 

Object obj = request.getAttribute("variableName");
 
0
Abilash
 
 
Answer
First of all u have to set the value by setAttribute() 
method such as:
request.setAttribute("variableName",object);

Then u have to forward that request to other servlet by 
using that procedure,

ServletContext con=request.getServletContext();
RequestDispatcher rd=con.getRequestDispatcher("/servlet");
rd.forward(request,response);

U can get that information from that servlet by using the 
method::
getAttribute("variableName");
 
0
Debojit
 
 
Answer
First of all u have to set the value by setAttribute() 
method such as:
getServletContext().setAttribute("variableName",object);

Then u have to forward that request to other servlet by 
using that procedure,


RequestDispatcher rd=getServletContext
().getRequestDispatcher("/servlet");
rd.forward(request,response);

U can get that information from that servlet by using the 
method::
getServletContext().getAttribute("variableName");
 
0
Debojit
 
 
Answer
for example if you want to pass your name from one servlet 
to another,

in fiest servlet file....

String name = "Tom"
request.setAttribute("name",name);

RequestDispatcher dis = request.getRequestDispatcher
("Servlet2");

request.Forward(request,response);



in second servlet file....

request.getAttribute("name");
//this line will display "Tom"
 
0
Kuru
 
 
Question
What is the use join() in Threads ?
Rank Answer Posted By  
 Question Submitted By :: Harish
This Interview Question Asked @   HCL
I also faced this Question!!   © ALL Interview .com
Answer
It waits for the Parent Thread process to be completed.  
Even though, Child process is completed.  It waits for the 
Parent Thread.
 
2
Harish
 
 
Answer
waits for specified number of milliseconds for thread to die
 
5
Padmaja
 
 
Answer
if we  want  to finish main thread last i.e  to ensure all 
child threads terminate prior to the main thread
 
0
Madan
 
 
Question
What is the use of anonymous inner classes ?
Rank Answer Posted By  
 Question Submitted By :: Harish
This Interview Question Asked @   HCL
I also faced this Question!!   © ALL Interview .com
Answer
an anonymous class is a local class that has no name
 
0
Harish
 
 
Answer
anonymous classes help to declare a class and create an 
instance of a class in the same step.
 
0
Chandrarekha
 
 
Answer
Anonymous classes

1.These are one  type of inner class that  having no mame.

2.The syntax will come like 

class a
{
public void mymethod ();

}
class b
{
a obja = new a(){//the anonymous class starts here
public void mymethod (){ //have to implement the methods of
//class 'a'
return "here we are implementing mymethod of class 'a'"
}

}; //when finishing anonymous classes we have to put";"

}

3.Here the anonymous class is consider as a sub class of
class 'a'.We can access all the variables and methods of
super class 'a' through the anonymous block,except local
variables,including private variables.

4.Through anonymous classes we can create instance for
Interfaces.
 
0
Ashokkumar
 
 
Answer
Anonymous class helps in Eventhandling
 
0
Guest
 
 
Answer
Anonymous class exist till the method or block (In which it 
is defined) runs. After that it vanishes so it help to use 
the memory efficiently.

in your code if you want a particular class once and that 
is also in the method/block use anonymous class.

it is the best of my knowledge. if you know more please 
reply me.
 
0
Sumit Bansal
 
 
Answer
We can declare an inner class within the body of a method 
without naming it. These classes are known as anonymous 
inner classes
         Very useful for controlled access to the innards 
of another class. and useful when we need one instance of a 
special class.
 
0
Bindhu
 
 
Answer
Anonymous class is a class which has no methods defined in 
it.
Eg.
class a
{
public void hello();
}
class b
{
a obj = new a();
public void hello()
{
System.out.println("Hello World");
}
}
 
0
Jubin Thomas, Bhilai(mpccet)
 
 
Question
What is the format of Inner Class after it compiled?
Rank Answer Posted By  
 Question Submitted By :: Harish
I also faced this Question!!   © ALL Interview .com
Answer
OuterClass$InnerClass.class
 
0
Harish
 
 
Question
What is the life cycle of Thread ?
Rank Answer Posted By  
 Question Submitted By :: Harish
This Interview Question Asked @   HCL
I also faced this Question!!   © ALL Interview .com
Answer
Once you create a Thread Class.  Instantiate the Thread and 
invoke the method start.  It intern triggers the run method 
on the Thread.  Once the run method is completed, The 
thread will be in dead state.
 
0
Harish
 
 
Answer
1. when the thread create New State
2. after start()  Runnable state
3. Running State
4. Wait/Block/Sleep State
5. Dead State
 
4
Chinnadurai
 
 
Answer
1.create the thread on which object u want, using Thread
interface,
2.then use obj.start() to invoke the thread
3.this method will intern call run() of Thread class 
4.once it's serviced, it will come to dead state.
 
0
Harmeet
 
 
Answer
Multithreading is the mechanism in which more than one 
thread run independent of each other within the process. 
wait (), notify () and notifyAll() methods can be used for 
inter-thread communication and these methods are in Object 
class. wait() : When a thread executes a call to wait() 
method, it surrenders the object lock and enters into a 
waiting state. notify() or notifyAll() : To remove a thread 
from the waiting state, some other thread must make a call 
to notify() or notifyAll() method on the same object.
 
0
Shajin.a.xavier
 
 
Answer
Ready-to-run
A thread starts its life cycle with a call to start(). For 
example

 MyThread aThread = new MyThread();
 aThread.start();

A call to start() will not immediately start thread's 
execution but rather will move it to pool of threads 
waiting for their turn to be picked for execution. The 
thread scheduler picks one of the ready-to-run threads 
based on thread priorities. 
Running
The thread code is being actively executed by the 
processor. It runs until it is swapped out, becomes 
blocked, or voluntarily give up its turn with this static 
method 
 Thread.yield();

Please note that yield() is a static method. Even if it is 
called on any thread object, it causes the currently 
executing thread to give up the CPU. 
Waiting
A call to java.lang.Object's wait() method causes the 
current thread object to wait. The thread remains 
in "Waiting" state until some another thread invokes notify
() or the notifyAll() method of this object. The current 
thread must own this object's monitor for calling the wait
(). 
Sleeping
Java thread may be forced to sleep (suspended) for some 
predefined time.

 Thread.sleep(milliseconds);
 Thread.sleep(milliseconds, nanoseconds);

Please note that static method sleep() only guarantees that 
the thread will sleep for predefined time and be running 
some time after the predefined time has been elapsed.
For example, a call to sleep(60) will cause the currently 
executing thread to sleep for 60 milliseconds. This thread 
will be in ready-to-run state after that. It will be 
in "Running" state only when the scheduler will pick it for 
execution. Thus we can only say that the thread will run 
some time after 60 milliseconds. 
Blocked on I/O.
A java thread may enter this state while waiting for data 
from the IO device. The thread will move to Ready-to-Run 
after I/O condition changes (such as reading a byte of 
data). 
Blocked on Synchronization.
A java thread may enter this state while waiting for object 
lock. The thread will move to Ready-to-Run when a lock is 
acquired. 
Dead
A java thread may enter this state when it is finished 
working. It may also enter this state if the thread is 
terminated by an unrecoverable error condition.
 
0
Shajin.a.xavier
 
 
Answer
start
run
destroy  are the methods

born 
runnable
running
sleep/blocked
dead          are the states

 
0
Ravikiran
 
 
Question
How to set the Heap size in Java ?
Rank Answer Posted By  
 Question Submitted By :: Harish
This Interview Question Asked @   HCL , HCL
I also faced this Question!!   © ALL Interview .com
Answer
set JAVA_OPTS=-server -Xmx700m
 
0
Harish
 
 
Answer
The heap size of the JVM can be set by specifying the
command-line flags -Xms and -Xmx

-Xms sets the initial heap size ( example: -Xms 30m )

-Xmx sets the maximum heap size ( example: -Xmx 70m )

Hope it helps! :)
 
0
Ranganathkini
 
 
Question
Is JRE required to compile Java files ?
Rank Answer Posted By  
 Question Submitted By :: Harish
This Interview Question Asked @   HCL
I also faced this Question!!   © ALL Interview .com
Answer
To compile a Java file, it should have a tools.jar and 
dt.jar in the classpath.  It should have a javac 
executable.  It compiles the class file.  If you want to 
execute the class file, you should have a Java Run-time 
Environment. (JRE)
 
0
Harish
 
 
Answer
no
 
1
Madan
 
 
Answer
see,javac is compiler of java which is use to convert 
the .java file into .class file,but only .class file can 
not exceute the java program for exceuting java program we 
should require a enviorment and a JIT compiler,the 
enviorment over which .class file exceutes itself is called 
jre(java runtime enviorment),Na JIt compliler which works 
as interepter for .class file ,that makes java plate for 
independent
 
0
Abhishek
 
 
Question
whats the relation ship between LDAP and JNDI?
Rank Answer Posted By  
 Question Submitted By :: Harish
I also faced this Question!!   © ALL Interview .com
Answer
JNDI has classes provided by SUN that will help ur appln 
interact with and LDAP server. JNDI appln work similarly to 
JDBC applns once and be free to use 'drivers' from 
different vendors. SUN provides the "driver" that will help 
interact with the LDAP server. Sun also provides "drivers" 
for other naming services (like CORBA). what SUN has not 
written is a driver to interact with ADSI.
 
0
Harish
 
 
Question
what protocols does JNDI provide an interface to?
Rank Answer Posted By  
 Question Submitted By :: Harish
I also faced this Question!!   © ALL Interview .com
Answer
JNDI itself is independent of any specific directory access 
protocol,individual service providers determine the 
protocols to support. There will be provider 
implementations for popular protocols such as LDAP,NDS,DNS 
and NIS(YP) supplied by different vendors.
 
0
Harish
 
 
Question
where is JNDI being used in java platform?
Rank Answer Posted By  
 Question Submitted By :: Harish
I also faced this Question!!   © ALL Interview .com
Answer
HOtJava views  using JNDI to access LDAP. Enterprise APIs 
such as Enterprise Java Beans,Java Message Service, and 
JDBC 2.0 make use of JNDI  for their naming and directory 
needs. RMI over IIOP applications can use JNDI to access 
the CORBA(COS) naming service.
 
2
Harish
 
 
Answer
JNDI is a naming service provided an Application Server, 
where as Application Server provides some external services 
like transactions and Naming Services so with the 
Application Servers to access the components (EJB) it 
dynamically use the naming service with JNDI, for this we 
need to configure the component to the namin service with 
rebind() method
 
0
Satya
 
 
 
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