Professional Documents
Culture Documents
Sample Interview Questions For Core Java
Sample Interview Questions For Core Java
When we are sending the serialized array object thro the network, what is being
passed? is the value or the reference ?
When you have an object passed to a method and when the object is reassigned to
a different one, then is the original reference lost
Will there be a performance penalty if you make a method synchronized? If so, can
you make any design changes to improve the performance
Why java does not support Multiple Inheritance? Why java is not pure Object
Oriented?
How a Hashtable can change the iterator? Can a HashMap change the iterator?
What is EJB
How do i upload a file from client side to server side using servlet and jsp this will
happen when I click upload button on web-page?
Disadvantages of Java
It is a saying that static methods in JAVA programs should be minimised. What is the
reason for this? any problems arise or there is any performance measures to be
looked into it.
What is a memory footprint? How can you specify the lower and upper limits of the
RAM used by the JVM? What happens when the JVM needs more memory
How can you swap two variables without using a third variable?
Does JVM maintain a cache by itself? Does the JVM allocate objects in heap? Is this
the OS heap or the heap maintained by the JVM? Why
What does a static inner class mean? How is it different from any other static
member
Whether we can set the time implicitly for the garbage collection?
What is the purpose of interface? And tell the difference between the class and
interface?
What is the difference between an object and an instance? And give me a real time
example to differentiate these two?
When you use a struts framework, where would you place your business logic
Can we declare multiple main() methods in multiple classes.ie can we have each
main method in its class in our program?
What is EJB?
When two entity beans are said to be identical?Which method is used to compare identical
or not?
With EJB 1.1 specs, why is unsetSessionContext() not provided in Session Beans, like
unsetEntityContext() in Entity Beans.
How will you propagate exception thrown inside session bean to JSP or Servlet client ?
Can we use instance variables in Stateless session beans? If yes, Why and How? If the
answer is no , explain why and how?
What is the difference between JNDI context, Initial context, session context and ejb
context?
What is ACID?
How to insert new row and link like Edit and Delete ?
What are the various isolation levels in a transaction and differences between them ?
What is Session Bean. What are the various types of Session Bean ?
Give a scenario where you have used stateless session beans and why was it necessary?
What are the various transaction attributes and differences between them ?
What is the difference between Stateful session bean and Stateless session bean ?
Can I develop an Entity Bean without implementing the create() method in the home
interface ?
What are simple rules that a Primary key class has to follow ?
What is CMR ?
what is requestdespatcher?
Can undefined primary keys are possible with Entity beans?If so, what type is defined?
Is it possible to invoke multiple Session beans from one Session bean using Reflection ?
When you will chose Stateful session bean and Stateless session bean ?
What is clustering. What are the different algorithms used for clustering ?
How do you check whether the session is active in Stateful session bean ?
What is Entity Bean. What are the various types of Entity Bean ?
What is the difference between distributed transactions and Flat transactions in EJB?
Can a Session Bean be defined without ejbCreate() method ?
What is JSP?
How do I prevent the output of my JSP or Servlet pages from being cached by the browser?
How do I have the JSP-generated servlet subclass my own custom servlet class, instead of
the default?
How do you prevent the Creation of a Session in a JSP Page and why?
If you want a servlet to take the same action for both GET and POST request, what should
you do?
When a servlet accepts a call from a client, it receives two objects. What are they?
What are Custom tags. Why do you need Custom tags. How do you create Custom tag ?
Is it possible to share an HttpSession between a JSP and EJB? What happens when I change
a value in the HttpSession from inside an EJB?
What are the differences between GET and POST service methods?
What information that the ServletRequest interface allows the servlet access to?
What are the implicit objects in JSP & differences between them
Is there a way I can set the inactivity lease period on a per-session basis?
Which code line must be set before any of the lines that use the PrintWriter?
What information that the ServletResponse interface gives the servlet methods for replying
to the client?
What is jsp:usebean. What are the scope attributes & difference between these attributes ?
How can I set a cookie and delete a cookie from within a JSP page?
Can you make use of a ServletOutputStream object from within a JSP page?
What is Declaration ?
How can I enable session tracking for JSP pages if the browser has disabled cookies?
What are the differences between GET and POST service methods?
When a servlet accepts a call from a client, it receives two objects. What are they?
If you want a servlet to take the same action for both GET and POST request, what should
you do?
What information that the ServletRequest interface allows the servlet access to?
What are the differences between GET and POST service methods?
What information that the ServletResponse interface gives the servlet methods for replying
to the client?
Which code line must be set before any of the lines that use the PrintWriter?
What is JDBC?
What is a transaction ?
What are the three statements in JDBC & differences between them ?
"select * from user" .what are the steps to take for execution of query in JDBC ?
How we can check in particular page the session will be alive or not?
When we increase the buffer size in our project using page directive attribute 'buffer' what
changes we observe?
When a servlet accepts a call from a client, it receives two objects. What are they?
What are the differences between GET and POST service methods?
What information that the ServletRequest interface allows the servlet access to?
What is difference between sendRedirect() and forward()..? Which one is faster then other
and which works on server?
What information that the ServletResponse interface gives the servlet methods for replying
to the client?
How many ServletConfig and servlet context objects are present in one application?
If you want a servlet to take the same action for both GET and POST request, what should
you do?
What is a better approach for enabling thread-safe servlets and JSPs? SingleThreadModel
Interface or Synchronization?
How the server will know (i.e) when it can invoke init, service,destroy methods of servlet life
cycle?
How to communicate between two servlets?
How will u pass the argument from one servlet to another servlet?
Types of Servlets?
Which code line must be set before any of the lines that use the PrintWriter?