jdevelopers guide_ ibm java interview questions for 3-8 year experience

3

Upload: nipulal

Post on 14-Sep-2015

226 views

Category:

Documents


1 download

DESCRIPTION

JDevelopers Guide_ IBM Java Interview Questions

TRANSCRIPT

  • class.

    Q. Is this possible to write final method in abstract class?

    Ans : Yes, you can do this by using non abstract methods.

    Q. What is Difference between Iterator and ListIterator?

    Ans : Both are used to retrieve the data from collection. Iterator only traverse in forward direction,but ListIterator can traverse in both forward and backward direction. ListIterator hashasPrevious() and previous() method which is not available in Iterator.

    Q. Difference between synchronized block and synchronized method ?

    Ans : Synchronized Method defines a self contained block and its easy to handle in multi-threaded environment. Both act as similar; there is no major advantage over each other. Thedifference is that a synchronized block can choose which object it synchronizes on. Asynchronized method can only use 'this' (or the corresponding Class instance for asynchronized class method).

    Q. Difference between String and StringBuffer class ?

    Ans : String is immutable, but StringBuffer is not. StringBuffer used to represent characters thatcan be modified. StringBuffer is faster when performing concatenations. This is because whenyou concatenate a String, you are creating a new object (internally) every time since String isimmutable.

    Q. How to get the session object in jsp?

    Ans : By using implicit object session. You can use session.getAttributes() methods.

    Select Language

    Convert this post to your Language

    with Google Friend Connect

    Members (12)

    Already a member? Sign in

    Join us for new Posts

    Subscribe By Email

    Sapient Interview Questions and Answers forJava 2 - 6 YearExperience - 2/11/2015 - Manoj KumarBardhanHow to skip test case in Maven build? - 12/21/2014 - Manoj Kumar BardhanHow to create maven job inJenkins - 12/21/2014 - Manoj Kumar BardhanDetecting the current branch failed: fatal: refHEAD is not a symbolicref - 12/17/2014 - Manoj Kumar BardhanSEVERE: Catalina.start:org.apache.catalina.LifecycleException:Failed to startcomponent - 11/29/2014 - Manoj KumarBardhan

    Feed This

  • Q. How to get the session factory object in hibernate?

    Ans : By the use of buildSessionFactory() method .Syntax as below.

    SessionFactory factory= new Configuration().configure().buildSessionFactory();

    Q. How to handle the runtime exception in jsp?

    Ans : In jsp page directive you can use isErrorPage=true.

    Q. Difference between method overloading and overriding?

    Ans : Both are concept of polymorphism. Method overloading is a form of static binding. Methodoverriding is a form dynamic binding. Overloading is applied in single class, but overriding isapplicable for inherited class. Method overloading is always specific to method signature. Itdefines number of parameter, type of parameter and sequence of parameter.

    Q. Difference between java.util.date and java.sql.date ?

    Ans : As we know every database support most three form of entry i.e. date, time and timestamp. In java JDBC having all those supports using java.sql.Date, java.sql.Time,java.sql.TimeStamp. Internally all these JDBC classes extends java.util.Date.

    Q. I have 1 to 100 elements in array unordered, one element missed find that one?

    Ans : There is existing old formula. Calculate the sum of all numbers stored in the array of size 11means it hold 12 data. Then, subtract the sum from (12 * 13)/2

    2015 (1) 2014 (20)December (3)November (1)October (2)September (8)August (2)July (1)June (2)March (1)

    2013 (9)2012 (43)2011 (35)

    Blog Archive

    core java (21) Database (23) Database Backup (7)design partten (4)

    HTML (12)Interface (4) Interview

    Questions (8) J2EE (8) Java Script (10) JSP (4)

    JVM (5) JVM Advance Setting (5) JVMErrors (6)

    MYSQL (30) Question Answer (4)

    Servlet (5) SQL (16) Struts (6)

    All Posts

    Capgemini Interview Questions and Answers

    Popular Posts