0% found this document useful (0 votes)
25 views

Java Interview Questions

top 50 Java Interview latest Questions

Uploaded by

Aryan Sharma
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Java Interview Questions

top 50 Java Interview latest Questions

Uploaded by

Aryan Sharma
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

 Is Java Platform Independent if then how?

 What are the top Java Features?


 What is JVM?
 Difference between JVM, JRE, and JDK.
 Explain public static void main(String args[]) in Java.
 What is Java String Pool?
 What will happen if we don’t declare the main as static?
 What are Packages in Java?
 Why Packages are used?
 What are the advantages of Packages in Java?
 Explain different data types in Java.
 Can we declare Pointer in Java?
 What is the Wrapper class in Java?
 Why do we need wrapper classes?
 What are the default values assigned to variables and instances in
Java?
 What is a Class Variable?
 What is the default value stored in Local Variables?
 Explain the difference between instance variable and a class variable.
 What is a static variable?
 What is the difference between System.out, System.err, and
System.in?
 What do you understand by an IO stream?
 What is the difference between the Reader/Writer class hierarchy and
the InputStream/OutputStream class hierarchy?
 What are the FileInputStream and FileOutputStream?
 What is the purpose of using BufferedInputStream and
BufferedOutputStream classes?
 How many ways you can take input from the console?
 What is covariant return type?
 What is the transient keyword?
 What are the differences between String and StringBuffer and
StringBuilder?
 Why string is immutable in java?
 How is the creation of a String using new() different from that of a
literal?
 What is an array in Java?
 What is the difference between int array[] and int[] array?
 What is an object-oriented paradigm?
 What are the main concepts of OOPs in Java?
 What is the difference between an object-oriented programming
language and an object-based programming language?
 What are Classes in Java?
 What is the difference between static (class) method and instance
method?
 What is this keyword in Java?
 What are Brief Access Specifiers and Types of Access Specifiers?
 What will be the initial value of an object reference which is defined as
an instance variable?
 What is an object?
 What is the constructor?
 What happens if you don’t provide a constructor in a class?
 How many types of constructors are used in Java?
 Where and how can you use a private constructor?
 What are the differences between the constructors and methods?
 What is an Interface?
 Give some features of the Interface.
 What is a marker interface?
 What are the differences between abstract class and interface?
 What do you mean by data encapsulation?
 What are the advantages of Encapsulation in Java?
 What is the primary benefit of Encapsulation?
 What do you mean by aggregation?
 What is the ‘IS-A ‘ relationship in OOPs Java?
 What are the different types of inheritance in Java?
 What is multiple inheritance? Is it supported by Java?
 What is an association?
 What do you mean by aggregation?
 What is the composition of Java?
 State the difference between Composition and Aggregation.
 Can the constructor be inherited?
 What is Polymorphism?
 What is method overriding?
 What is method overloading?
 Can we override the static method?
 Can we override the overloaded method?
 Can we overload the main() method?
 What are method overloading and method overriding?
 Can we override the private methods?
 Can we change the scope of the overridden method in the subclass?
 Can we modify the throws clause of the superclass method while
overriding it in the subclass?
 What is Abstraction?
 What is Abstract class?
 When Abstract methods are used?
 What is Collection Framework in Java?
 Explain various interfaces used in the Collection framework.
 What is a priority queue in Java?
 Explain the LinkedList class.
 What is the Stack class in Java and what are the various methods
provided by it?
 What is Set in the Java Collections framework and list down its various
implementations?
 What is the HashSet class in Java and how does it store elements?
 What is a Map interface in Java?
 Explain Treemap in Java
 What is an Iterator?
 What is the difference between Collection and Collections?
 Differentiate between Array and ArrayList in Java.
 What is the difference between Array and Collection in Java?
 Difference between ArrayList and LinkedList.
 Differentiate between ArrayList and Vector in Java.
 What is the difference between Iterator and ListIterator?
 What is the difference between Comparable and Comparator?
 What is the difference between Set and Map?
 What is the difference between List and Set?
 What is Exception Handling?
 How many types of exceptions can occur in a Java program?
 Difference between an Error and an Exception.
 Explain Runtime Exceptions.
 What is NullPointerException?
 What is the difference between Checked Exception and Unchecked
Exception?
 What is the base class for Error and Exception?
 Is it necessary that each try block must be followed by a catch block?
 What is exception propagation?
 How do exceptions affect the program if it doesn’t handle them?
 What is the use of the final keyword?
 What purpose do the keywords final, finally, and finalize fulfill?
 What is the difference between this() and super() in Java?
 What do you mean by a Multithreaded program?
 What are the two ways in which Thread can be created?
 What is a thread?
 Differentiate between process and thread?
 Describe the life cycle of the thread?
 What is a daemon thread?
 What are the different types of Thread Priorities in Java? And what is
the default priority of a thread assigned by JVM?
 What is join method in Thread?
 Why Garbage Collection is necessary in Java?
 What is a memory leak, and how does it affect garbage collection?
 Write a regular expression to validate a password. A password must
start with an alphabet and followed by alphanumeric characters; Its
length must be in between 8 to 20.
 What is JDBC?
 What are the steps to connect to the database in Java?
 Differentiate between List and Set.
 Differentiate between List and Map.
 Differentiate between Queue and Stack.
 Differentiate between PriorityQueue and TreeSet.
 Differentiate between the Singly Linked List and Doubly Linked List.
 Differentiate between Queue and Deque.

You might also like