Java Interview Questions

The tech job market is very
active these days, particularly in the developing world. Techies seem to be jumping jobs left, right and center.

Naturally the most discussed topics in developer circles are jobs and job interview questions.

During discussions with a few developer friends, we came up with this idea of creating a databank of frequently asked
interview questions (FAQs).

The
easy way to create this interview questions databank, is to ask as many
people as possible to share the questions they were asked or the
questions that they asked.

If you wish to share Java Interview Question/s, please
add a comment to this particular item.

Please copy paste the following format and add your comment.
We will later compile all data into any easy to use format, mostly an
Excel sheet.

Name (optional):
Company (optional):
Location –
Job Position-
Experience-
Skills –
Questions & Answers:

(Update: Aug 06) – Comments over the past year suggest that in Java questions 1) Interfaces 2) Abstract classes are easily the most popular topics. While for web applications questions related to request, session and application scopes are popular.

For questions on:
Software Quality and Testing Interview Questions
Python Interview Questions

Related:
Java and J2EE Today: An interview with Satish Talim
Interviews with Java experts

Content Team

The IndicThreads Content Team posts news about the latest and greatest in software development as well as content from IndicThreads' conferences and events. Track us social media @IndicThreads. Stay tuned!

95 thoughts on “Java Interview Questions

  • May 6, 2007 at 7:40 pm
    Permalink

    heres a list of some more questions
    wat is the life cycle of a servlet?
    tell me a one real instance where u used abstract class
    what is meant by bytecode
    explain ejb in terms of serializationa nd multithreading?

  • May 6, 2007 at 7:37 pm
    Permalink

    hi,
    this is a gud site and it has enabled me to get an insight of wat questions mite be asked
    pls put in more questions in respect to varying experience and technologies

  • March 30, 2007 at 11:41 pm
    Permalink

    To prepare for IT interview, you may consider [URL=http://www.technical-interview.com]Technical-Interview.com[/URL]. Many questions and answers are listed there. I found it useful for my interview

  • March 12, 2007 at 2:03 am
    Permalink

    Its a great site. I want to know about pack() method in JAVA. 🙂

  • February 9, 2007 at 11:20 am
    Permalink

    1. I have a set of stmts. how do you synchronize them
    Ans : Using Synchronized blocks
    3. difference between Vector and ArrayList
    Ans : Vector thread safe and ArrayList is not
    Q. DIfference between dictionery and hashmap

    Q. In Oracle Pl/SQL, how parameters are passed in and out? Is it pass by value or pass by reference?

    Q. Difference between container and component
    Ans : Component does not support Transaction, security and other services but Container does.

    Q. what is innerjoin? what is outer join?

    Q. explain MVC architecture

    Q. How do you capture n present the life cycle of a project

    Q. difference between SAX n DOM

    Ans :
    1. SAX is event based where DOM is not
    2. SAX consumes less main memory compared to DOM
    3. Using DOM one can update the XML content, but one cannot update the XML content using SAX

    Q. What is open source according to you.

    Q. difference between Hibernate n EJB
    Hibernate is lightweight compared to EJB

    Q. Explain struts

    Q. How do u write a servlet? how do u deploy?

    Q. How do you represent a PDF file in XML? given x.pdf file, which represents an aplication form, how you will fill-it up with the data from the database?

  • January 28, 2007 at 11:52 pm
    Permalink

    Hello How to prepare java in the interview point of view :grin

  • January 4, 2007 at 2:32 am
    Permalink

    Name (optional): Citadel
    Company (optional):
    Location – Pune
    Job Position- Senior Software Engineer
    Experience- 3+
    Skills – Java/j2EE
    Questions & Answers:
    1. How to kill all the threads in a program in one command.
    2. Diff between arryList and Vector
    3. Which interface is serialised
    4. difference between throw and throws
    5. What is the program o/p
    try{
    return 1
    }
    catch()
    {
    retrun 2
    }
    finally
    {
    return 3
    }
    the o/p when error dosent come, when error come

  • November 15, 2006 at 5:31 am
    Permalink

    The questions are quite same can any one put up some questions with current topics

  • October 18, 2006 at 10:52 pm
    Permalink

    why are methods like notify(),notifyAll(),wait present in super class Object?

    wait and notify are methods in the basic class Object,so they are shared by all objects in the system

  • October 16, 2006 at 7:30 am
    Permalink

    [B]what is difference between application page and contextpage[/B]

  • October 4, 2006 at 3:51 pm
    Permalink

    Transient Variable is the one which does not serialize its value. Suppose if you want the value is not to serialize to declare that variable as transient is enough 🙂

  • September 28, 2006 at 12:47 am
    Permalink

    How we connect from the EJB class to servlet. Do possible.

  • September 15, 2006 at 6:00 am
    Permalink

    sameer
    Location -noida
    Job Position-Dev
    Experience-2
    Skills -java,jsp,servlet,struts,j2me
    Questions & Answers:
    here i m providing questions with ans bcoz i hv seen that mostly asked questions only but dont provide ans which makes ppls to search out over net

    What is the difference between interface and abstract class?

    1Â…Â…Â…all the methods in the interface will be abstract

    2Â…Â…Â…abstract class may contain concrete methods.

    3Â…Â….interface contains variables that must be static and final;
    abstract class may contain both non-final and final variables.

    4Â…. members in an interface are public by default, abstract class may contain non-public members.

    5Â…Â…interface is used to ‘implements’; whereas abstract class is used to ‘extends’.

    6Â….interface can be used to achieve multiple inheritance; abstract class can be used as a single inheritance.

    7Â….interface can ‘extends’ another interface, abstract class can ‘extends’ another class and ‘implements’ multiple interfaces.

    8.. interface is absolutely abstract; abstract class can be invoked if a main() exists.

    9Â….interface is more flexible than abstract class because one class can only ‘extends’ one super class, but ‘implements’ multiple interfaces. If given a choice, use interface instead of abstract class

    QUes —4 Why do we need interface in Java. Instead of interface we can write the methods in the class itself. Why do we need seperate interface?
    Ans
    1Â…Java don’t support Multiple Inheritance. For that we can use Interface. Not always we write methods in Interface, we can also create objects in the Interface. The Object which will be shared between two classes can be created in an Interface.
    2Â…Â…Interface acts as communicator for the classes.since interface contains many empty bodies here we can take the advantage of the property of the interface and we can have diffrent implementations for same method as per its use in diffrent classes so interfaces are needed.

    which one is thread safe,(1)Arraylist(2)Vector(3)Map(4)Table?
    What is mean by Singletone object how to create it???
    Ans
    Vector is thread Safe.
    Singleton Class is a class of which we can make only one object.The programm checks whether any object of that class exists or nor,if it finds the existing one then returns that Object otherwise creates a new one..
    The progamm below shows a Singleton class ..this will help u..
    public class SingletonTest
    {
    private static SingletonTest obj;
    private SingletonTest()
    {
    /* ..code..*/
    }
    public static SingletonTest onlyInstance()
    {
    if(obj==null)
    {
    obj=new SingletonTest();
    return obj;
    }
    else
    return obj;
    }
    }

    u can mail ur question related queries
    [QUOTE] adonis_sameer@hotmail.com [/QUOTE]

  • September 12, 2006 at 12:08 am
    Permalink

    What is diffrent ApplicationPage and Context Page? 🙂

  • September 5, 2006 at 10:38 pm
    Permalink

    why are methods like notify(),notifyAll(),wait present in super class Object

  • August 28, 2006 at 3:33 am
    Permalink

    Q:- What is the difference between Web Server and Application Server=> It supports Load Balance,cache control and it supports HTTP, TCP/Ip and all protocols. But Web server can supports only HTTP.

  • August 24, 2006 at 6:11 am
    Permalink

    A Webser does not have a EJB Container(EJB Server) and a AppServer contains an EJB Container.

    For eg: Tomcat has a webcontainer ONLY which can be used to deploy servlets and JSP’s but one cannot deploy EJB’s on tomcat. But can be deployed on Appserver such as J2EE Server /Web Logic.

  • August 7, 2006 at 3:15 am
    Permalink

    Q:- What is the difference between Web Server and Application Server?

Leave a Reply