Top 200 Java Technical Interview Questions book contains the Top 200 Java Technical interview questions that you can expect in a Java interview. Each question is accompanied with an answer because you want to save precious time to prepare for a job interview.
We have compiled this list of these questions based on the experience of dozens of technical interviews in top technology companies like- Google, Facebook, Oracle, Amazon etc.
Sample questions are:
Why constructors cannot be final, static, or abstract in Java?
Can we inherit a Constructor?
If there are no pointers in Java, then why do we get NullPointerException?
What is meant by covariant return type in Java?
Is it possible to achieve Runtime Polymorphism by data members in Java?
Does Java allow us to use private and protected modifiers for variables in interfaces?
Why a String object is considered immutable in java?
How will you create an immutable class in Java?
What is the difference between Serializable and Externalizable interface?
In Java, if we do not specify any value for local variables, then what will be the default value of the local variables?
What is the difference between JDK and JRE?
What is Java Virtual Machine (JVM)?
What are the different types of memory areas allocated by JVM?
What is JIT compiler?
How Java platform is different from other platforms?
Why people say that Java is ‘write once and run anywhere’ language?
How Multi-threading works in Java?
What are the advantages of Multithreading?
What are the disadvantages of Multithreading?
What is a Thread in Java?
What is a Thread’s priority and how it is used in scheduling?
What are the differences between Pre-emptive Scheduling Scheduler and Time Slicing Scheduler?
What is the purpose of join() method in Thread class?
What is the fundamental difference between wait() and sleep() methods?
Is it possible to call run() method instead of start() on a thread in Java?
What is a daemon thread in Java?
How can we make a regular thread Daemon thread in Java?
How will you make a user thread into daemon thread if it has already started?
Can we start a thread two times in Java?
What is a Shutdown hook in Java?
In what scenarios can we interrupt a thread?
What is synchronization in Java?
What is the purpose of Synchronized block in Java?
What is static synchronization?
In Java, is it possible to lock an object for exclusive use by a thread?
How notify() method is different from notifyAll() method?
What is a Deadlock situation?
How does ClassLoader work in Java?
Do you think ‘main’ used for main method is a keyword in Java?
Can we write main method as public void static instead of public static void?
What is Runtime Polymorphism?
Let say, we run a java class without passing any arguments. What will be the value of String array of arguments in Main method?
What is the difference between byte and char data types in Java?
What are the main principles of Object Oriented Programming?
What is the difference between Object Oriented Programming language and Object Based Programming language?
In Java what is the default value of an object reference defined as an instance variable in an Object?
Why do we need constructor in Java?
Why do we need default constructor in Java classes?
What is the value returned by Constructor in Java?
What is the purpose of ‘this’ keyword in java?
Explain the concept of Inheritance?