ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel
  • »
  • Business and Employment»
  • Employment & Jobs»
  • Interviewing for a Job

Top 50 Java Interview Questions You Shouldn't Miss.

Updated on December 16, 2015
lenodrow profile image

Leno Drow has been working as a freelance web developer and UX analyst for the past 4 years.

Intro to Java Interview Questions and Answers.

Java is a programming language which marked itself in the history of computer programming languages. Java unlike other high level programming languages is flexible and expandable, this vast features of Java makes it difficult for students or interviewee to tackle a Java interview. Without further thoughts we can say that Java interview questions and answers are very helpful for any candidate who needs to attend an interview focused around the Java Programming language .

But a single source of questions like books won't help you tackle the Java game. So in order to cover these vast pockets of Java and win the interview game, we used different sources including Java support forums, Java community websites, previous interview questions etc to make Java interview questions which are close to practice rather than theory.

We have spend more than 120 hours to make these Java interview questions and answers and hope these questions and answers will help you easily tackle the interview .

The interview questions and answers are applicable for both freshers and experienced Java professionals (7-10 years)

Congratulations for your interview in advance.

Source

Instructions

This Hub contains both subjective and objective questions and the interviewee are advised to take the objective test first before answering the subjective questions to analyse your level of expertise. When attending the subjective questions, candidates must write down the questions in a notebook and answer the the questions within 30 minutes or a maximum of 60 minutes .

After completing the subjective questions users can check their answers with the answers given in this Hub. The answers do not need to match but should point in the same direction.


Table of Contents

This Hub is divided into different sections based on the experience level of the interviewee or the candidate. All sections contain 10 to 100 questions and answers which are subjective and an objective questionnaire which can be used to check your present knowledge level.

Java Interview Questions - Live Test (objective)

The 4 interview question types given below are objective in nature and users need to select the correct answer to complete the questionnaire.

Java Interview Questions (subjective)

The 4 interview question types given below are subjective in nature and users need to answer them subjectively.

Java Interview Questions - Answers (subjective)

The given below are answers to the subjective Java interview questions. Candidates are requested to try to answer the questions by yourself before reading the answers.

#1 Java Frequently Asked Interview Questions - Live Test


view quiz statistics

#1 Java Frequently Asked Interview Questions

  1. What is the difference between JVM, JDK, JRE ?
  2. What are the different data types supported by Java?
  3. What is the advantage of Java architecture?
  4. What is a Just In Time Compiler or JIT ?
  5. What is the advantage of Java to an environment?
  6. What is an IDE ? Explain popular IDE with respect to JAVA.
  7. What is a Java exception ?
  8. What is the use of Dynamic Binding?
  9. Is it possible to use >> operator instead of >>> operator? Why?
  10. How to put a task to ready state?

#1 Answers - Java Frequently Asked Interview Questions

  1. The JVM or the Java Virtual Machine runs the code, the JRE and JDK are both development environments but the JDK or the Java Development Kit is more advanced than JRE or Java Runtime Environment because of the presence of additional tools like compilers and debuggers in the JDK.
  2. The different data types supported by the Java language are byte,short,int,long,float,double,Boolean and char.
  3. The advantage of Java architecture over other programming languages is that it has a neutral architecture. Java makes it possible to run its code on different machines of different architecture with the help of its compiler and JRE (Java Runtime Environment). Java can be run on both x86 and ARM devices due to its neutral architecture.
  4. Normally high level programming languages are slow due to the distance it keeps from the processor which finally executes the code. Java uses the JIT or Just In Time Compiler to convert the Java codes into processor instructions which reduces the overall execution time by making it easier for the processor to execute the codes. This feature of Java makes it faster over other high level programming languages.
  5. An environment which gets developed over time requires the programs to change the code according to the new environment. Java makes it extremely easier to update the program codes with the help of its huge library, programs can auto update the code by considering different environmental factors.
  6. IDE is the short for an Integrated Development Environment, Netbeans and Eclipse are the 2 popular IDE which are available for free.
  7. Java exceptions are Java conditions resulted from bad input and they are different from other Java conditions because they are recoverable.
  8. In Java if a code needs to be executed when a call is made, a linking procedure called Binding is needed. If the code that needs to be executed when a call is made is unknown until the time of call then Dynamic Binding is required.
  9. No, both operators are different in the bit level.
  10. A task should follow a yield() method to put it to ready state.

#2 Java Freshers Interview Questions - Live Test


view quiz statistics

#2 - Java Interview Questions For Freshers

  1. Explain 4 different Object Oriented Programming Concepts.
  2. How to search for data using Java ?
  3. What is network programming ?
  4. What is TCP and UDP ?
  5. If a thread becomes dead, how can we restart it ?
  6. What is a Java Applet ?
  7. How threads are executed by Java ?
  8. Explain different methods available in the Java Thread class .
  9. Explain static methods available in the Java Thread class.
  10. Explain the Java collections framework.

#2 Answers - Java Interview Questions For Freshers

  1. Encapsulation, inheritance, polymorphism, and abstraction are the 4 different core object oriented programming concepts.
  2. Regular expressions can be used to search for data, Java provides the java.util.regex package for regular expressions.
  3. Computer networking means connecting different computers together using wired or wireless methods. Network Programming is used to write programs that can execute in a network.
  4. TCP - Transmission Control Protocol, UDP - User Datagram Protocol. Both transmission protocols can be used to communicate effectively between applications over a network.
  5. It is not possible to restart a dead thread.
  6. A Java Applet is nothing but a Java application that can run in a web browser.
  7. Java threads are executed on the basis of their priority ranging from MIN_PRIORITY to MAX_PRIORITY.
  8. public void start(),public void run(),public final void setName,public final void setPriority,public final void setDaemon,public final void join,public void interrupt,public final boolean isAlive
  9. public static void yield(),public static void sleep,public static boolean holdsLock,public static Thread currentThread(),public static void dumpStack()
  10. Different collections are unified into a single platform called the collections framework. All collections framework can contain Interfaces,Implementations and Algorithms.

#3 Java Experienced Interview Questions - Live Test


view quiz statistics

#3 Java Interview Questions For Experienced

  1. How to fix a Null Pointer Exception?
  2. How to compare strings in Java?
  3. What is a raw type ?
  4. How to print a Java array ?
  5. How to parse JSON in Java?
  6. How to round a number in Java?
  7. What causes the ArrayIndexOutOfBoundsException ?
  8. What are the differences between public, private and protected in Java?
  9. How to create a text file in java?
  10. What is the use of Reflection in Java?


#3 Answers - Java Interview Questions For Experienced

  1. A Null Pointer Exception can be fixed by creating an object before declaring a variable.
  2. The "Objects.equals()" can be used to compare strings in Java.
  3. A raw type is a generic type declaration without any accompanying parameters.
  4. Print a java array using "System.out.println(Arrays.toString(array));"
  5. The org.json library can be used to parse JSON in Java.
  6. The "setRoundingMode" command can be used to round a number to the required number of decimal places.
  7. When an Array is accessed by an illegal index the "ArrayIndexOutOfBoundsException" is thrown by the system.
  8. The only difference between the public and protected is that the "world" is not accessible in the protected mode. In private only the "class" is accessible.
  9. A new text file can be created using the "PrintWriter writer = new PrintWriter("name.txt", "UTF-8"); command.
  10. Reflection is the practice of using a code to inspect other codes inn the system.


Source

#5 Dress Code For The Java Interview

  • Dress according to your profession
  • Wear clean or new clothes
  • Avoid perfumes
  • Wear suits if possible .
  • Avoid bright colors.
  • Make sure your hair is neat.
  • Take a bath in the morning or few hour before the interview to keep fresh.
  • Check your breath.
  • Sleep well the day before interview to prevent fatigue.


Source

#6 The Interview Checklist


view quiz statistics

Help Us Improve This Hub

Tell Us Who You Are

See results

© 2015 Leno Drow

Comments

    0 of 8192 characters used
    Post Comment

    No comments yet.