Careers
Companies
Topics
Get Started
Interview Coach 1:1
Gain the confidence you need by asking our professionals any interview scenario, question, or answer you are unsure about.
Let Us Review Your Answers
Our interviewing professionals will gladly review and revise any answer you send us. Allowing you to craft perfect responses for your next job interview.
Interview Questions by Topic
Interview Questions by Career
Interview Questions by Company

Java Developer Interview
Questions

20 Questions and Answers by William Swansen
| William Swansen is an author, job search strategist and career advisor who assists individuals from all over the world.

Question 1 of 20

What are some examples of JDBC drivers?

1000s of Interview Questions

Win your next job by practicing from our question bank. We have thousands of questions and answers created by interview experts.

Java Developer Interview Questions

  1. 1.

    What are some examples of JDBC drivers?

      This is a follow-up to a previous question. Any time you provide an interviewer with the answer, you should anticipate a follow-up question. This indicates that they either need more information or have a specific interest in this topic. If there are several follow-up questions about the same topic, they indicate that the subject is important to their operations. You should use it as a clue to talk more about the subject when answering their questions. Your answer to this question may sound something like this: "There are four basic types of JDBC drivers. The drivers work in conjunction with the JDBC API to connect with and extract information from databases. The four drivers are ODBC, Native API, Pure Java driver for Database Middleware, and Direct-to-Database Pure Java Driver."

      William's Answer

      "There are four basic types of JDBC drivers. The drivers work in conjunction with the JDBC API to connect with and extract information from databases. The four drivers are ODBC, Native API, Pure Java driver for Database Middleware, and Direct-to-Database Pure Java Driver."

  2. 2.

    What are the key elements of the Java programming language?

      This is the type of question an interviewer will use to begin the conversation, learn more about your background, and collect information they can use throughout the interview. This question also provides you the opportunity to direct the interview towards a subject area that you are familiar with and comfortable responding to questions about. Throughout the interview, keep your answers brief and to the point. This will encourage the interviewer to ask follow-up questions about the same topic or move on to a new subject.

      William's Answer

      "There are several key features of the Java programming language. First, it is simple to learn. Next, Java is somewhat object-oriented and enables programmers to manage their code using objects. Several other key features of Java include its portability, platform independence, security, and the large library of code available to programmers."

  3. 3.

    How is Enum used in Java?

      You should already recognize this as a technical question. It is asking you how a concept or process is used within the Java programming language. Continue to answer technical questions directly and briefly, with little embellishment, anticipating follow-up questions from the interviewer.

      William's Answer

      "Enum is a type whose field is made up of fixed sets of constants. An example of this would be the setting of times within a Java program as morning, noon, afternoon, and evening. These become key words used to create enum types, which are similar to a class."

  4. 4.

    Talk about what a Java timer class is and how you schedule a task to run after a specific interval?

      Another classically formatted technical question. You are being asked to define a concept and then discuss how it is used in your work. Remember to keep your answer brief and to the point, and provide an example if you think it will enhance your response. Always be prepared for follow-up questions when you provide an answer.

      William's Answer

      "A Java timer class is a subclass of a java.util package. It is used to schedule a thread that is executed in the future. An example of one use is for scheduling a task which will be run at regular intervals."

  5. 5.

    Within Java, what are the differences between path and classpath variables?

      This is a common format of a technical question. Technical questions ask you about concepts or items related to the work you do. They sometimes ask you to compare similar concepts or to describe how they are used. When answering technical questions using this format, you should first define the terms you were asked about. You then either compare them or describe how they are used. You may provide an example if it helps illustrate your answer.

      William's Answer

      "Both path and classpath are environmental variables which the operating system uses to locate executables. The OS locates the executables in a directory location, which is defined by these variables. The difference between a path and classpath variable is that a classpath is very specific to Java and can be defined as a directory, ZIP file, JAR file or another type of variable."

  6. 6.

    Can you discuss what a static import is and what the pitfalls of using this are?

      This technical question asks you to first define the concept and then describe some features of its use. This is a common format for technical questions. When answering a question during an interview, you should anticipate follow-up questions. These indicate that the interviewer needs additional information or has a strong interest in the topic they are asking about. It may also be an indicator that the topic is important to the operations of the organization.

      William's Answer

      "Static import is the process of importing the class and the method variable with the class name from another class. This makes the class available. The pitfall of using this methodology is that it may cause confusion if it is overused and thereby trigger the program to malfunction."

  7. 7.

    Tell me about the Java Reflection API?

      As the interview progresses, the technical questions will become more difficult. This indicates that the interviewer is gaining confidence in your qualifications and is willing to explore your background in more depth. Continue to answer the questions, in the same manner, keeping your answers brief and to the point.

      William's Answer

      "The Java Reflection API enables you to test and modify applications while they are running. You can inspect the various elements of the java programming language, seeing the details. Java developers use this to debug and improve their programming."

  8. 8.

    Please describe the JDBC API and discuss how it is used?

      Another classic technical question asking you to define a concept and then describe how it is used. Continue to keep your answers brief and to the point, and feel free to provide an example if you think it will embellish or enhance your answer. Always be prepared for follow-up questions.

      William's Answer

      "JDBC stands for Java Database Connectivity. The API enables java programs to work with relational databases. This enables the program to connect with the database, run SQL queries, and process the results."

  9. 9.

    When programming in Java, can you have an empty catch block?

      This is an example of an operational question. Operational questions evaluate specific elements used in your job. Like technical questions, answers to operational questions should be brief and to the point. You should also anticipate follow-up questions if the interviewer needs additional information or wants to explore the topic in more detail. Your answer to this question can sound something like this: "While you can use an empty catch block while programming in Java, it is not advised. The problem this creates involves debugging the program if the empty catch block were to catch an exception. There will not be any information about the exception. Finding the issue with no information in the log could be very time-consuming."

      William's Answer

      "While you can use an empty catch block while programming in Java, it is not advised. The problem this creates involves debugging the program if the empty catch block were to catch an exception. There will not be any information about the exception. Finding the issue with no information in the log could be very time-consuming."

  10. 10.

    How does an OutOfMemoryError impact a program written in Java, and how can this be corrected?

      This is an example of a hybrid technical and operational question. While technical questions ask you about specific concepts, operational questions explore how you do your job. This question first asks you to define how a specific concept impacts your program and then discuss how to remediate it. As with technical questions, hybrid or operational questions should be answered briefly and to the point.

      William's Answer

      "An OutOfMemoryError is created by the JVM when there is no memory available for it to use. This will result in a program halting. The simple way to fix this is to allocate more memory to run in the java application."

  11. 11.

    Please define a CountDownLatch in the context of Java?

      You'll note that this question simply asks for a definition of a term used within the java programming language. You can only provide the definition or enhance your answer by describing how it is used and providing an example. Your choice of how to respond to this question will be based on your perception of the interviewer, the interview's progress, and whether you feel providing a more in-depth answer will better demonstrate your qualifications for the job.

      William's Answer

      "The CountDownLatch, as used in Java is a synchronizer which enables a thread to wait for one or more other threads before it starts processing."

  12. 12.

    Can you discuss the differences between a user and a daemon thread?

      A common format of technical questions is asking you to compare two terms. The best way to respond to these types of questions is to first define the terms, and then compare the differences or similarities. You may even want to provide an example to help illustrate your answer.

      William's Answer

      "The differences between a user thread and a daemon thread are how they are created, and their impact on JVM. User threads are created by programmers, while daemon threads run in the background. If a user thread is present, the JVM will not shut down, and the program will continue to run. However, the presence of a daemon thread does not prevent the JVM from terminating."

  13. 13.

    Can you tell me what a Compare and Swap algorithm is and how you use it when coding in Java?

      This is a more complex technical question, which asks you to define a term and then discuss how it is used when creating a Java program. Regardless of whether a question is simple or complex, it would be best to keep your answer brief and to the point. The interviewer will either ask for more information or move on to the next topic.

      William's Answer

      "Compare and Swap is a type of instruction which helps to synchronize threads in a multi-threading environment. The way it works is to examine the content of a memory location and, if it matches another location, it modifies the value of the content and creates a new value. This prevents the content from being used by another thread and a write operation failing."

  14. 14.

    What is a marker interface, and how do you use it when writing Java code?

      The fact that this is a technical question is obvious since it asks you to define a term and then discuss how it is used. Make sure you answer each part of the question in the order asked. This will help the interviewer follow your answer and confirm that you are listening to their questions during the interview.

      William's Answer

      "A marker interface, as it is used in Java, is a design pattern which provides runtime information about the objects within the program. It also enables the addition of metadata with a class even though the Java language doesn't implicitly support metadata. When coding in Java, the marker interface is used as an interface which doesn't specify a method."

  15. 15.

    What is Composition, as used in Java?

      As the interview progresses, the hiring manager will continue to ask you technical questions about writing programs within Java. Some of these will be very simple, asking you to define basic concepts that any programmer should know. Others will be more complex and require you to give longer, more complicated answers to define the concept, describe how it is used, and give an example of how to write the code. The best way to prepare for these is the practice these types of questions, stating the answers out loud, so you become comfortable doing this.

      William's Answer

      "Composition is a method used in Java to implement has-a relationships within classes. This facilitates code reuse through object composition. When using composition, you implement instance variables that refer to different objects. The benefit is to provide visibility of the objects to other classes so they can reuse them."

  16. 16.

    How are access modifiers in used Java?

      View All 20 Java Developer Answers
      Sign up to access our library of 50,000+ Answers,
      plus coaches for one-on-one support, so you can interview more confidently.
  17. 17.

    How is a volatile keyword used in Java?

      View All 20 Java Developer Answers
      Sign up to access our library of 50,000+ Answers,
      plus coaches for one-on-one support, so you can interview more confidently.
  18. 18.

    Can you define the final keyword in Java?

      View All 20 Java Developer Answers
      Sign up to access our library of 50,000+ Answers,
      plus coaches for one-on-one support, so you can interview more confidently.
  19. 19.

    In your opinion, Is Java Pass By Value or Pass By Reference?

      View All 20 Java Developer Answers
      Sign up to access our library of 50,000+ Answers,
      plus coaches for one-on-one support, so you can interview more confidently.
  20. 20.

    Can you discuss the importance of the main() method in Java?

      View All 20 Java Developer Answers
      Sign up to access our library of 50,000+ Answers,
      plus coaches for one-on-one support, so you can interview more confidently.