Java Interview Questions and Answers

This will help you get a full sense of the developer’s character, his/her goals and the value they will provide to the company. Not only will you be expected to explain your skills, but you can also expect to be asked to demonstrate them. As with just about any job in the industry, tech tests generally make up a portion of the Java Developer interview. Give an example of functionality that can only be implemented using reflection. Generally, the safety and flexibility of enums means they should be used in place of integer constants, and switch statements can be eliminated with liberal use of abstract methods.

The doGet() method is used to handle HTTP GET requests, while the doPost() method is used to handle HTTP POST requests. The main difference between the two methods is that the GET request parameters are passed in the URL, while the POST request parameters are passed in the request body. java 7 certifications This driver used to convert the JDBC class to client API for the database servers. Database client API should be installed because of the extra dependency on the database client API drivers. Overuse of static import create confusion and make the program unreadable and unimaginable.

What are the differences between abstract class and interface?

Errors and Exceptions both have a common parent class which is java.lang.Throwable class. ArrayStoreException is thrown when an attempt is made to store the wrong type of object in an array of objects. In Collections, Elements are not necessarily stored in contiguous memory locations. In an Array, Elements are stored in contiguous memory locations. Programmers can convert an Array to ArrayList using asList() method of the Arrays class. It is a static method of the Arrays class that accepts the List object.

If you create a similar method with the same return type and same method arguments in child class then it will hide the superclass method; this is known as method hiding. Similarly, you cannot override a private method in subclass because it’s not accessible there. What you can do is create another private method with the same name in the child class. Let’s take a look at the example below to understand it better.

What is BlockingQueue?

In the first call to the constructor, The constructor with one argument is called, and i will be initialized with the value 10. However, In the second call to the constructor, The constructor with the 2 arguments is called, and i will be initialized with the value 15. Based on the parameters passed in the constructors, there are two types of constructors in Java. There are the following basic differences between the object-oriented language and object-based language.

ContextLoaderListener, on the other hand, is the listener to start up and shut down the WebApplicationContext in Spring root. Some of its important functions includes tying up the lifecycle of Application Context to the lifecycle of the ServletContext and automating the creation of ApplicationContext. Note that the availability of certain scopes depends on the type of application context you are using (e.g., web application context). You should use execute() method only when you are not sure about the type of statement else use executeQuery or executeUpdate method.


อีเมลของคุณจะไม่แสดงให้คนอื่นเห็น ช่องข้อมูลจำเป็นถูกทำเครื่องหมาย *