Birlasoft Java Interview Questions & Answers

5 avg. rating (100% score) - 5879 votes

Birlasoft Java Interview Questions & Answers

To get an interview call is an achievement in itself. The main purpose of your interview is to show that you have required skills, abilities and background to do the job and perfectly fit into the organization. To make your interview successful wisdomjobs an online portal will ensure you to be on right path.

Java is a programming language, developed by Sun Microsystems and was first released in 1995. Since then it has become worldwide popularity because of its distinct features. A Java programme is a hardware and operating system independent. That is if java code is written perfectly then the same one is compiled at one time runs without any help on PCs, Macintosh computer etc. Its unique feature is object oriented language which mainly assists software developers. In recent years much more changes have been made to Java class. The demand for Java and its origin in software development has given scope in future.

Top most recruiters are looking for Java developers with experienced or fresher’s who has completed their,, MCA,BCA with excellent communication skills, and should be passionate about enhancing the developing skills. Here we have come up with advanced Java interview questions and answers so that the job seekers can analyse it and prepare carefully for the final interview.

Birlasoft Java Interview Questions

Birlasoft Java Interview Questions
    1. Question 1. Is Java Pass By Reference Or Pass By Value?

      Answer :

      Its always pass by value .

    2. Question 2. What Is The Difference Between An Interface And An Abstract Class?

      Answer :

      Both are looks similar. But, the basic difference is abstract class can contain abstract and non abstract methods, where interface only contains abstract method (without method body). You can declare fields that are not static and final, and define public, protected, and private concrete methods in abstract class. But, in Interface all members are public, static and final , all methods are public.

    3. Question 3. What Is The Purpose Of Garbage Collection In Java, And When Is It Used?

      Answer :

      Garbage collection is a special feature in java language. It helps developer to save time and extra mental tension for handling object allocation in memory. It automatically clean the unused object from memory which helps to allocate space at runtime. When there is no reference to an object found, it will clean that object from memory . You can run the garbage collection explicitly by using System.gc().

    4. Question 4. What Is Marker Interface? How Is It Used In Java?

      Answer :

      Marker interface is an interface which help us to notify few information to JVM/Compiler. The marker interface does not have any body, it’s a empty interface. Ex. Cloneable, Serialization, etc.

    5. Question 5. Can You Give Few Examples Of Final Classes Defined In Java Api?

      Answer :

      String, Integer ,Float ,etc. Basically all wrapper classed are final.

    6. Question 6. What Is The Importance Of Init() Method In Servlet?

      Answer :

      init() method is one of the life cycle method of servlet. This method runs once in total life. After servlet instance created and before it handles request the init() method will work. Its basically used for initializing values at the time of application startup.

    7. Question 7. How To Improve Servlet Performance ?

      Answer :

      You need to do few tuning for this achievement. Few points below:                                                           

      1.   Use init() method for all expensive operation during  initialization (may be static data or cached data ).   
      2.   Always avoid auto loading of servlet.
      3.   Avoid SingleThreadModel.
      4.   Use and control HttpSession properly.

    8. Question 8. How Can A Servlet Refresh Automatically If Some New Data Has Entered The Database?

      Answer :

      Basically it depends on the scenario , how you can handle. You need  handle this in dao layer, when doing insert operation you can call an utility method which will load the context ServletContextListener. Because, servlets are basically used for handling request and give the response.

    9. Question 9. How Does Jsp Handle Run-time Exceptions?

      Answer :

      You can use isErrorPage=”true” in page attribute

    10. Question 10. What Is An Ejb Context?

      Answer :

      The EJBContext interface provides an instance with access to the container-provided runtime context of an enterprise bean instance.

    11. Question 11. What Is The Main Difference Between Java Platform And Other Platforms?

      Answer :

      The Java platform differs from most other platforms in the sense that it’s a software-based platform that runs on top of other hardware-based platforms.

      It has two components:

      1. Runtime Environment
      2. API(Application Programming Interface)

    12. Question 12. When Abstract Methods Are Used?

      Answer :

      If you want a class to contain a particular method but you want the actual implementation of that method to be determined by child classes, you can declare the method in the parent class as abstract.

    13. Question 13. What Are Wrapper Classes?

      Answer :

      These are classes that allow primitive types to be accessed as objects. Example: Integer, Character, Double, Boolean etc.

    14. Question 14. What Do You Mean By Platform Independence?

      Answer :

      Platform independence means that we can write and compile the java code in one platform (eg Windows) and can execute the class in any other supported platform eg (Linux,Solaris,etc).

    15. Question 15. What Is A Pointer And Does Java Support Pointers?

      Answer :

      Pointer is a reference handle to a memory location. Improper handling of pointers leads to memory leaks and reliability issues hence Java doesn’t support the usage of pointers.

    16. Question 16. What Is The Difference Between Creating String As New() And Literal?

      Answer :

      When we create string with new() Operator, it’s created in heap and not added into string pool while String created using literal are created in String pool itself which exists in PermGen area of heap.

      String s = new String(“Test”);

      does not  put the object in String pool , we need to call String.intern() method which is used to put  them into String pool explicitly. its only when you create String object as String literal e.g. String s = “Test” Java automatically put that into String pool.

    17. Question 17. What Is The Use Of The Finally Block? Is Finally Block In Java Guaranteed To Be Called? When Finally Block Is Not Called?

      Answer :

      Finally is the block of code that executes always. The code in finally block will execute even if an exception is occurred. Finally block is NOT called in following conditions

      • If the JVM exits while the try or catch code is being executed, then the finally block may not execute. This may happen due to System.exit() call.
      • if the thread executing the try or catch code is interrupted or killed, the finally block may not execute even though the application as a whole continues.
      • If a exception is thrown in finally block and not handled then remaining code in finally block may not be executed.

    18. Question 18. What’s The Difference Between The Methods Sleep() And Wait()?

      Answer :

      The code sleep(2000); puts thread aside for exactly two seconds. The code wait(2000), causes a wait of up to two second. A thread could stop waiting earlier if it receives the notify() or notifyAll() call. The method wait() is defined in the class Object and the method sleep() is defined in the class Thread.

    19. Question 19. What Is The Difference Between An Interface And An Abstract Class ?

      Answer :

      An abstract class can have instance methods that implement a default behavior. An Interface can only declare constants and instance methods, but cannot implement default behavior and all methods are implicitly abstract. An interface has all public members and no implementation.

    20. Question 20. Difference Between Final, Finally And Finalize ?

      Answer :

      Final is used to apply restrictions on class, method and variable. Final class can’t be inherited, final method can’t be overridden and final variable value can’t be changed.

      Finally is used to place important code, it will be executed whether exception is handled or not.

      Finalize is used to perform clean up processing just before object is garbage collected. Finalize is used to perform clean up processing just before object is garbage collected.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd Protection Status

Java Tutorial