Core Java Interview Questions

Sunny
4 min readAug 26, 2021

--

In This Article, I will share the core java interview questions which are being asked frequently in almost all the interviews.

  1. Difference Between JVM, JDK, JRE.
  2. Is JRE alone is used to run the program?
  3. What is JDK and which JDK tools you have used apart from IDE’s?
  4. What is Garbage Collection in java?
  5. What is Heap Memory in Java?
  6. Memory Storage in java.
  7. What is Overloading Vs Overriding?
  8. Method Overloading, Class Overloading.
  9. Overloading of Static Methods, Static Class, FInal Method, Final Class.
  10. Can Variable be overloaded? Static & Final Variables overloading.
  11. Class Variable, Instance Variable, Local Variable, Static Variable, Final variable.
  12. Type Conversion in Overloading.
  13. Method Overriding, Class Overriding.
  14. Dynamic Dispatch Polymorphism.
  15. Final Method, Static Method, Final Variable, Static Variable Overriding.
  16. Difference Between Hiding & Overriding.
  17. Public, Private, Default, Protected Method Overriding.
  18. Access Modifiers in case of Overriding. Public to Protected OR Protected to public.
  19. Can we override Constructor?
  20. Can we overload the Constructor?
  21. Exception Handling in case of Overriding. How Exceptions can be declared for sub-class & super-class.
  22. Abstract Method Overriding & Overloading.
  23. Final Keyword: Variable, method, Class, Constructor. It’s impact on Overloading & overriding and how the class object can use. FInal variables are being most tricky questions, so better prepare each aspect of the Final Keyword.
  24. Static Keyword: Variables, Blocks, Methods, Nested Class, Class. The static keyword is being used at many places and for interviews, this is the most important part of Core Java.
  25. Nested/Inner Class: Local Inner Class, Annonymous Inner Class, Static Nested Class. In the Anonymous Inner class, thread questions are asked, runnable, how you can create an anonymous class, anonymous inner class.
  26. Abstract Keyword: Class, Method, Constructor in Abstract Class, Object of Abstract Class, Instance of Abstract Class, Abstract Method Overriding & Overloading.
  27. Interface: Methods in interface, default methods use in the interface in java 8, the constructor in an interface, Instance of the interface.
  28. Difference Between Interface & Abstract.
  29. Encapsulation: How Encapsulation can be achieved, why we use encapsulation.
  30. Java Beans.
  31. Functional Interface: Usage of functional Interface, which is a purely functional interface, how can you create the functional interface. What is an Inbuilt Functional Interface? What are Predicates?
  32. Diamond Problem in Java, How to solve the diamond problem.
  33. Volatile & Transient Keyword. Usage, difference, and when to use.
  34. String: String Literal, why string is immutable, Where it is stored, how to make it mutable. Some Questions on overloading, overriding and input-output.
  35. String Buffer, String Builder.
  36. Lambda Expression: Create a lambda expression, how to use a lambda expression, why we use a lambda expression, create a generic Lambda expression. Lambda Expression with the program of a sum of two numbers.
  37. Streams: In Java 8 there is the functionality of Stream, many questions will be asked on this. How to use stream, with filter, collections, map, collect. When to use stream.
  38. Optional: This is also a java 8 feature, it is used to handle Null Pointer.
  39. Final, Finally, Finalize. Difference between them.
  40. Finally, usage program with return in the try, catch, and finally blocks. you will get a program where there would be 3 return statements in the try, catch & finally, and upon that questions would be asked. No Matter what finally block will always execute, then how the return statement is executed when an exception occurs and when the exception doesn’t occur.
  41. Try, Catch, Finally Block Usage.
  42. What happens when we don’t catch the exception.
  43. Throw & Throws Keyword.
  44. Exception Types. Difference between Compile time & run time exception.
  45. How to catch different types of exceptions.
  46. Exception Propagation in Child & Parent Class.
  47. Autoboxing
  48. .intern()
  49. Create an immutable class with DateTime, modify the immutable class.
  50. Why CharArray is preferred over String to store the password. Its impact on threads.
  51. IO Streams, Difference between Reader/Writer Class & Input/Output Stream class.
  52. Purpose of Using BufferedInputStream & BufferedOutputStream.
  53. What is Serialization?
  54. What is Externalizable?
  55. What is a Native Method?
  56. Which kind of thread is the garbage collector thread?
  57. Regular Expression: Validate Password, Phone, Email.
  58. Java Conversion of Into to String, Int to Long, String to Int, String to Long, Double, String to Date, Date to String, etc.
  59. Java Util Date Methods, Java SQL Date. Jakarta Date. Java Calendar, Java TimeZone.
  60. Formatting & Parsing of String, Date.
  61. File Handling in Java, Java I/O, Scanner, FileInput/Output, File Reader/Writer, CharArray Reader/Writer.
  62. What is a Fully Encapsulated Class, how to create it?
  63. Object Cloning in Java.
  64. Usage of this & super keyword in constructor, method.
  65. Difference between Coupling & Cohesion.
  66. Different types of Association in Java.
  67. Aggregation Vs Composition.
  68. How is the Covariant return type is implemented?
  69. Difference between Static & Dynamic Binding.
  70. Java instance Operator.
  71. Interface Vs Abstract.
  72. Different types of Access Modifiers in Java & Usage.
  73. Wrapper Classes.
  74. Strcitfp.
  75. Call By Value, Call By Reference.

Links & Website for Preparation :

  1. GeekforGeeks: Check for the Java Interview Questions, Core Java Concepts, and most frequently asked questions.

https://www.geeksforgeeks.org

2. Interviewbit: Check for Questions related to Java in this.

https://www.interviewbit.com

--

--