Core Java Interview Questions
Explain on Internal Working of HashMap
What is Platform Independency?
What is the role of ClassLoader?
What is the use of join method in threads?
Is Java pass by value or pass by reference?
What is the purpose of introduction of Generics?
What is the difference between PATH and CLASSPATH?
Why isn’t Java a 100% object-oriented language?
Explain on static blocks.
Why do we need Wrapper Classes?
What are the differences between String and StringBuffer?
What are the differences between StringBuffer and StringBuilder?
Explain the Java Object Law for hashCode() and equals().
Explain on Method Overloading.
Explain on Method Overriding.
Is Multiple Inheritance allowed in Java? If not, how to achieve it?
Explain few important points on Interfaces.
Explain the differences between Abstract Class and Interface.
How do you call a Super Class Constructor from a Constructor?
What are the uses of this keyword in Java?
Will super class constructor gets called when no explicit call from child class?
What is Polymorphism? What are its advantages?
What is Encapsulation?
Explain on Nested Inner class.
Explain on Method-Local Inner class.
Explain on Anonymous Inner class.
Explain on Static Nested class
Explain on default access modifier.
Explain on Protected access modifier.
Explain on Private access modifier.
Explain on final modifier.
Explain on Enhanced For Loop.
What is the need for finally block?
In what scenarios the code in finally block will not get executed?
Can you explain the hierarchy of Exception Handling classes?
What is the difference between Error and Exception?
What is the difference between Checked Exceptions and Unchecked Exceptions?
Can you explain about try with resources?
What is an Enum?
What are Variable Arguments or varargs?
Explain on Automatic Garbage Collection.
Explain on finalize().
What is Serialization? Explain.
What is serialVersionUID? Explain.
What are the important interfaces in the Collection Hierarchy?
What are the important methods that are declared in the Collection Interface?
Explain on ArrayList.
Explain on Enumeration Interface.
Explain on Iterator.
Explain on ListIterator.
How do you sort elements in an ArrayList using Comparable interface?
How do you sort an ArrayList using Comparator interface?
Is Enumeration fail-fast?
Is Iterator fail-fast?
How Vector is different from an ArrayList?
What is LinkedList? How is it different from an ArrayList?
Explain on Queue Interface.
What are the important interfaces and classes related to the Set Interface?
What is the difference between Set and SortedSet interfaces?
What is a HashSet?
What is a LinkedHashSet? How is it different from HashSet?
Explain on NavigableSet.
What is a TreeSet? How is it different from HashSet?
Explain briefly about Deque Interface?
Explain on BlockingQueue interface.
What is the difference between Map and SortedMap?
Explain on Navigable Map.
Explain on CopyOnWriteArrayList?
What is difference between fail-fast and fail-safe iterators?
Explain on Atomic Classes.
How do you declare a Generic Class?
How can we restrict Generics to a subclass of particular class?
Give an example of Generic Method.
What are the different ways in which a thread can be created?
What are the different states of a Thread?
What is priority of a thread? How do you change the priority of a thread?
Can a static method be synchronized?
Explain on the method Yield().
Explain on the methods wait() and notify(). Implement Producer-Consumer scenario
What is a Stream?
Explain on intermediate and terminal operations in streams.
What are Method References? What are the various kinds of method references?
Explain Java coding conventions for classes
Explain Java Coding standards for interfaces.
Explain Java Coding standards for Methods.
Explain about instanceof operator in Java.
Can we have multiple classes in single file?
What all access modifiers are allowed for top class?
Explain Naming Conventions for Packages.
Can we write any code after throw statement?
Explain when NoClassDefFoundError will be raised.
Explain when ClassNotFoundException will be thrown.
What are different types of multitasking?
What is the difference between process and thread?
What is a lock or purpose of a lock in Java?
In how many ways we can do synchronization in Java?
Assume that a thread has lock on it,will calling sleep() on that thread release?
Among the two ways of creating a thread, what is the best way?
Explain about interrupt() method of thread class.
Explain which of the following methods release the lock when executed?
What are daemon threads in java?
Can we change Main Thread to daemon?
Why to use nested classes in Java?
Will compiler create a default constructor if there a parameterized constructor
Can we override static methods in Java?
Explain on static imports in Java.
What is an Immutable Object? What is the strategy for defining Immutable Object?
Explain on CountDownLatch.
Explain on ThreadLocal class.
Explain on the class ThreadGroup.
Which Class is the superclass of every Class?
Does system.exit() in try block executes finally block?
What are Executors? What is their significance?
Explain on the interface Executor.
Explain on the interface ExecutorService. How is it different from the interface
Explain on shutdown() of ExecutorService.
Explain on shutdownNow() of ExecutorService.
Explain on awaitTermination() of ExecutorService.
Explain on the interface ScheduledExecutorService.
Explain on the class Executors.
Explain on the interface ThreadFactory.
Explain the significance of CompletionService.
Explain the functioning of cancel() of Future class.
Explain on Tight Coupling and Loose Coupling.
Is it allowed to assign a parameterized type to its raw type?
What are various Restrictions on Generics?
What is the advantage of default methods in Interfaces?
What is the advantage of private methods in Interfaces?
Can we use Diamond Operator with Anonymous Classes?
What is Implicit Casting?
What is Explicit Casting?
What is OutOfMemoryError?
Where are String values stored in memory?
What is the difference between == and equals() method?
What is Jar Hell / ClassPath Hell?
Explain on the interface Externalizable.
Can you explain a few exception handling best practices.
Name the methods of an Object class.
Explain on Heap Polution.
When does a Java Collection throw UnsupportedOperationException?
Can you explain the relationship between Lambda Expression and Functional Interf
Are Constructors of an object invoked when the object is de-serialized?
Where to use and where not to use Assertions?
For which purpose we use @SafeVarargs?
Explain the differences between Runnable and Callable.
Explain on LoadFactor of a HashMap.
Explain the difference between Synchronized Collections and Concurrent Collectio
Explain the differences between Synchronized Map and ConcurrentHashMap.
Explain on the interface Lock. How is it different from using synchronized appro
Explain the difference between final and immutable.
When to use String, StringBuffer, and String Builder?
Are Singleton Classes thread safe? Explain on Bill Pugh Singleton Implementation
Explain on Reentrant Lock.
Explain on CyclicBarrier
Explain the differences between CountDownLatch and CyclicBarrier.