Top 100 JAVA Interview Question & Answer | CodeBaaj |


🔹 Core Java Interview Questions (1–30)

1. Java क्या है?
👉 Java एक high-level, object-oriented, platform-independent programming language है।

2. Java को platform independent क्यों कहा जाता है?
👉 क्योंकि Java bytecode JVM पर run होता है, OS पर depend नहीं करता।

3. JVM क्या है?
👉 JVM (Java Virtual Machine) bytecode को machine code में convert करता है।

4. JDK क्या है?
👉 JDK = JRE + Development Tools (javac, debugger आदि)

5. JRE क्या है?
👉 JRE Java programs को run करने का environment देता है।

6. Java में main method क्यों जरूरी है?
👉 Program execution main() method से शुरू होता है।

7. Java में data types कितने होते हैं?
👉 2 types – Primitive और Non-Primitive

8. Primitive data types कौन-कौन से हैं?
👉 byte, short, int, long, float, double, char, boolean

9. Java में class क्या है?
👉 Class object बनाने का blueprint होती है।

10. Object क्या है?
👉 Class का instance object कहलाता है।


🔹 OOPs Concepts (31–55)

31. OOPs क्या है?
👉 Object-Oriented Programming System

32. OOPs के principles कौन से हैं?
👉 Encapsulation, Inheritance, Polymorphism, Abstraction

33. Encapsulation क्या है?
👉 Data + methods को एक unit में bind करना।

34. Inheritance क्या है?
👉 एक class का दूसरी class के properties inherit करना।

35. Polymorphism क्या है?
👉 Same method, different behavior।

36. Method Overloading क्या है?
👉 Same method name, different parameters।

37. Method Overriding क्या है?
👉 Parent class method को child class में redefine करना।

38. Abstraction क्या है?
👉 Implementation details hide करना।

39. Abstract class क्या है?
👉 ऐसी class जिसमें abstract methods हो सकते हैं।

40. Interface क्या है?
👉 100% abstraction provide करता है।

41. Abstract class और Interface में difference?
👉 Interface multiple inheritance support करता है।

42. Constructor क्या है?
👉 Object creation के समय call होने वाला method।

43. Constructor के types?
👉 Default और Parameterized

44. Java multiple inheritance support करता है?
👉 Class से नहीं, Interface से करता है।

45. this keyword क्या है?
👉 Current object को refer करता है।

46. super keyword क्या है?
👉 Parent class object को refer करता है।

47. final keyword क्यों use होता है?
👉 Value, method या class को change न करने के लिए।

48. Static keyword क्या है?
👉 Memory efficient, class level access देता है।

49. Static method object से call हो सकता है?
👉 नहीं, class से call होता है।

50. Java में access modifiers कौन से हैं?
👉 public, private, protected, default

51. private member access कहाँ possible है?
👉 Same class में।

52. public member access कहाँ possible है?
👉 Everywhere

53. protected member access कहाँ possible है?
👉 Same package + subclass

54. default access modifier क्या है?
👉 Same package में access

55. Object class क्या है?
👉 Java की root class


🔹 Exception Handling (56–70)

56. Exception क्या है?
👉 Runtime error को exception कहते हैं।

57. Exception के types?
👉 Checked और Unchecked

58. Checked Exception example?
👉 IOException, SQLException

59. Unchecked Exception example?
👉 NullPointerException

60. try-catch block क्यों use होता है?
👉 Exception handle करने के लिए।

61. finally block क्या करता है?
👉 Always execute होता है।

62. throw keyword क्या है?
👉 Manually exception throw करता है।

63. throws keyword क्या है?
👉 Exception declare करता है।

64. Custom Exception क्या है?
👉 User-defined exception

65. Error और Exception में difference?
👉 Error recover नहीं होता, Exception handle हो सकता है।

66. Multiple catch blocks allowed हैं?
👉 Yes

67. Catch block order क्या होना चाहिए?
👉 Child → Parent

68. RuntimeException क्या है?
👉 JVM द्वारा runtime पर generate होता है।

69. NullPointerException कब आती है?
👉 Null object access करने पर।

70. ArithmeticException कब आती है?
👉 Divide by zero पर।


🔹 String, Array, Collection (71–90)

71. String क्या है?
👉 Immutable object

72. String immutable क्यों है?
👉 Security और memory optimization के लिए।

73. StringBuffer क्या है?
👉 Mutable + Thread-safe

74. StringBuilder क्या है?
👉 Mutable + Fast (Non-thread safe)

75. String vs StringBuilder?
👉 String immutable, StringBuilder mutable

76. Array क्या है?
👉 Same data type का collection

77. Array index start कहाँ से होता है?
👉 0 से

78. Collection Framework क्या है?
👉 Data store और manipulate करने का framework

79. List interface implementations?
👉 ArrayList, LinkedList

80. Set interface implementations?
👉 HashSet, LinkedHashSet

81. Map interface implementations?
👉 HashMap, TreeMap

82. ArrayList और LinkedList difference?
👉 ArrayList fast access, LinkedList fast insertion

83. HashMap क्या है?
👉 Key-value pair store करता है।

84. HashMap duplicate keys allow करता है?
👉 No

85. HashMap null key allow करता है?
👉 Yes (1 null key)

86. Iterator क्या है?
👉 Collection traverse करने के लिए।

87. For-each loop क्यों use होता है?
👉 Easy iteration

88. Comparable interface क्या है?
👉 Single sorting logic

89. Comparator interface क्या है?
👉 Multiple sorting logic

90. Collection और Collections difference?
👉 Collection interface, Collections utility class


🔹 Advanced / Miscellaneous (91–100)

91. Java में multithreading क्या है?
👉 Multiple threads execute simultaneously

92. Thread create करने के ways?
👉 Thread class, Runnable interface

93. Synchronization क्या है?
👉 Thread safety ensure करता है।

94. Deadlock क्या है?
👉 Threads एक-दूसरे को wait करते रहते हैं।

95. Garbage Collection क्या है?
👉 Unused memory free करता है।

96. finalize() method क्या है?
👉 GC से पहले call होता है।

97. Java में package क्या है?
👉 Classes का group

98. Java में wrapper classes क्यों use होती हैं?
👉 Primitive को object में convert करने के लिए।

99. Autoboxing क्या है?
👉 Primitive → Object

100. Java use कहाँ होती है?
👉 Web apps, Android, Enterprise apps, Banking, Software development.

Leave a Reply

Your email address will not be published. Required fields are marked *