“Java Programming Questions With Answers".
Here, are some sample questions based on “Java Programming”. Read it carefully as these questions will improve your basic concept on Java programming, and will help you in cracking any interview.
Click on any question to find out it's answers:
1. What Do You Know About Java?
2. What Are The Supported Platforms By Java Programming Language?
3. List Any Five Features Of Java?
4. Why Is Java Architectural Neutral?
5. How Java Enabled High Performance?
6. Why Java Is Considered Dynamic?
7. What Is Java Virtual Machine & How It Is Considered In Context Of Java’s Platform Independent Feature?
8. List Two Java IDE’s?
9. List Some Java Keywords Unlike C, C + + Keywords?
10.What Do You Mean By Object?
11. Define Class?
12. What Kind Of Variables A Class Can Consist Of?
13. What Is A Local Variable?
14. What Is A Instance Variable?
15. What Is A Class Variable?
16. What Is Singleton Class?
17. What Do You Mean By Constructor?
18. List The Three Steps For Creating An Object For A Class?
19. What Is The Default Value Of Byte Datatype In Java?
20. What Is The Default Value Of Float & Double Datatype In Java?
21. When A Byte Datatype Is Used?
22. What Is A Static Variable?
23. What Do You Mean By Access Modifier?
24. What Is Protected Access Modifier?
25. What Do You Mean By Synchronized Non Access Modifier?
26. According To Java Operator Precedence, Which Operator Is Considered To Be With Highest Precedence?
27. Variables Used In A Switch Statement Can Be Used With Which Data Types?
28. When parseInt Method Can Be Used?
29. Why Is String Class Considered Immutable?
30. Why Is StringBuffer Called Mutable?
31. What Is The Difference Between StringBuffer & StringBuilder Class?
32. Which Package Is Used For Pattern Matching With Regular Expressions?
33. java.util.regex Consists Of Which Classes?
34. What Is Finalize Method?
35. What Is An Exception?
36. What Do You Mean By Checked Exceptions?
37. Explain Runtime Exceptions?
38. Which Are The Two Subclasses Under Exception Class?
39. When throws Keyword Is Used?
40. When throw Keyword Is Used?
41. How finally Keyword Is Used Under Exception Handling?
42. What Things Should Be Kept In Mind While Creating Your Own Exceptions In Java?
43. Define Inheritance?
44. When super Keyword Is Used?
45. What Is Polymorphism?
46. What Is Abstraction?
47. What Is Abstract Class?
48. When Abstract Methods Are Used?
49. What Is Encapsulation?
50. What Is The Primary Benefit Of Encapsulation?
51. What Is An Interface?
52. Give Some Features Of Interface?
53. Define Packages In Java?
54. Why Packages Are Used?
55. What Do You Mean By Multithreaded Program?
56. What Are The Two Ways In Which Thread Can Be Created?
57. What As An Applet? An Applet Extends Which Class?
58. Explain Garbage Collection In Java?
59. Define Immutable Object?
60. Explain The Usage Of This With Constructors?
61. Explain Set Interface?
62. Explain TreeSet?
63. What Is Comparable Interface?
64. Difference Between Throw & Throws?
65. Explain The Following Line Used Under Java Program − public static void main Stringargs
66. Define JRE i.e. Java Runtime Environment?
67. What Is JAR File?
68. What Is A WAR File?
69. Define JIT Compiler?
70. What Is The Difference Between Object Oriented Programming Language & Object Based Programming Language?
71. What Is The Purpose Of Default Constructor?
72. Can A Constructor Be Made Final?
73. What Is Static Block?
74. Define Composition?
75. What Is Function Overloading?
76. What Is Function Overriding?
77. Difference Between Overloading & Overriding?
78. What Is Final Class?
79. What Is NullPointerException?
80. What Are The Ways In Which A Thread Can Enter The Waiting State?
81. How Does Multithreading Take Place On A Computer With A Single CPU?
82. What Invokes A Thread's Run Method?
83. Does It Matter In What Order Catch Statements For FileNotFoundException & IOException Are Written?
84. What Is The Difference Between Yielding & Sleeping?
85. Why Vector Class Is Used?
86. How Many Bits Are Used To Represent Unicode, ASCII, UTF-16, & UTF-8 Characters?
87. What Are Wrapper Classes?
88. What Is The Difference Between A Window & A Frame?
89. Which Package Has Light Weight Components?
90. What Is The Difference Between The paint & repaint Methods?
91. What Is The Purpose Of File Class?
92. What Is The Difference Between The Reader/Writer Class Hierarchy & The InputStream/OutputStream Class Hierarchy?
93. Which Class Should You Use To Obtain Design Information About An Object?
94. What Is The Difference Between Static & Nonstatic Variables?
95. What Is Serialization & Deserialization?
96. What Are Use Cases?
97. Explain The Use Of subclass In A Java Program?
98. How To Add Menu Shortcut To Menu Item?
99. Can You Write A Java Class That Could Be Used Both As An Applet As Well As An Application?
100. What Is The Difference Between Swing & AWT Components?
101. What's The Difference Between Constructors & Other Methods?
102. Is There Any Limitation Of Using Inheritance?
103. When Is The ArrayStoreException Thrown?
104. Can You Call One Constructor From Another If A Class Has Multiple Constructors?
105. What's The Difference Between The Methods Sleep & Wait?
106. When ArithmeticException Is Thrown?
107. What Is A Transient Variable?
108. What Is Synchronization?
109. What Is The Collections API?
110. Does Garbage Collection Guarantee That A Program Will Not Run Out Of Memory?
111. What Is The Immediate Superclass Of The Applet Class?
112. Which Java Operator Is Right Associative?
113. What Is The Difference Between A Break Statement & A Continue Statement?
114. If A Variable Is Declared As Private, Where May The Variable Be Accessed?
115. What Is The Purpose Of The System Class?
116. List Primitive Java Types?
117. What Is The Relationship Between Clipping & Repainting Under AWT?
118. Which Class Is The Immediate Superclass Of The Container Class?
119. What Class Of Exceptions Are Generated By The Java Run-Time System?
120. Under What Conditions Is An Object's Finalize Method Invoked By The Garbage Collector?
121. How Can A Dead Thread Be Restarted?
122. Which Arithmetic Operations Can Result In The Throwing Of An ArithmeticException? Variable Of The Boolean Type Is Automatically Initialized As?
123. How Does A Try Statement Determine Which Catch Clause Should Be Used To Handle An Exception? Can Try Statements Be Nested?
124. Is It Necessary That Each Try Block Must Be Followed By A Catch Block?
125. What Are Class Loaders?
126. What Is The Difference Between An Interface & An Abstract Class?
127 .Can An Interface Extend Another Interface?
128. If A Method Is Declared As Protected, Where May The Method Be Accessed?
129. What Will Happen If Static Modifier Is Removed From The Signature Of The Main Method?
130. What Is The Default Value Of An Object Reference Declared As An Instance Variable?
131. What Is Nested Top-Level Class? Can A Top Level Class Be Private Or Protected?
132 .Why Do We Need wrapper Classes?
133. What Is The Difference Between Error & An Exception?
134. Describe Life Cycle Of Thread?
135. When A Thread Is Created & Started, What Is Its Initial State?
136. Explain Suspend, isAlive Method Under Thread Class? What Is currentThread?
137. Explain Main Thread Under Thread Class Execution?
138. What Is Daemon Thread? Which Method Is Used To Create The Daemon Thread? Which Method Must Be Implemented By All Threads?
139. What Is The Locale Class?
140. What Are Synchronized Methods & Synchronized Statements?
141. What Is Runtime Polymorphism Or Dynamic Method Dispatch?
142. Which Object Oriented Concept Is Achieved By Using Overloading & Overriding?
143. What Is Dynamic Binding?
144. Can Constructor Be Inherited? Where & How Can You Use A Private Constructor?
145. What Is Constructor Chaining & How Is It Achieved In Java?
146. What Are The Advantages Of ArrayList Over Arrays?
147. Why Deletion In LinkedList Is Fast Than ArrayList?
148. How Do You Decide When To Use ArrayList & LinkedList?
149. What Is A Values Collection View ?
150. What Is Dot Operator? What Is The Difference Between The >> and >>> Operators?
151. What Are Order Of Precedence & Associativity & How Are They Used?
152. What Is Type Casting? What Is Downcasting? Can A Double Value Be Cast To A Byte?
153. Which Method Of The Component Class Is Used To Set The Position & Size Of A Component?
154. What Is The Range Of The Short Type?
155. What Is The Immediate Superclass Of Menu?
156. Does Java Allow Default Arguments?
157. Which Number Is Denoted By Leading Zero In Java? Which Number Is Denoted By Leading 0x Or 0X In Java?
158. Break Statement Can Be Used As Labels In Java?
159. Where Import Statement Is Used In A Java Program?
160. What Are The Steps Involved In A Life Cycle Of An Applet?
161. Why Is The Role Of init Method Under Applets?
162. Which Method Is Called By Applet Class To Load An Image?
163. Define Code As An Attribute Of Applet?
164. Define Canvas?
165. Define Network Programming?
166. What Is A Socket? State The Advantages & Disadvantages Of Sockets?
167. Which Class Is Used By Server Applications To Obtain A Port & Listen For Client Requests?
168. Which Class Represents The Socket That Both The Client & Server Use To Communicate With Each Other?
169. Why Generics Are Used In Java?
170. What Environment Variables Do I Need To Set On My Machine In Order To Be Able To Run Java Programs?
171. Is There Any Need To Import java.lang Package?
172. What Is Externalizable Interface?
173. If System.exit 0; Is Written At The End Of The Try Block, Will The Finally Block Still Execute?
174. What Is The GregorianCalendar Class?
175. What Is The SimpleTimeZone Class?
176. What Is The Difference Between The Size & Capacity Of A Vector?
177. Can A Vector Contain Heterogenous Objects?
178. What Is An Enumeration?
179. What Is Difference Between Path & Classpath?
180. Can A Class Declared As Private Be Accessed Outside It's Package?
181. What Are The Restriction Imposed On A Static Method Or A Static Block Of Code?
182. What Is An Object's Lock & Which Object's Have Locks?
183. What Is The Difference Between Inner Class & Nested Class?
184. What Restrictions Are Placed On Method Overriding?
185. What Will Be The Default Values Of All The Elements Of An Array Defined As An Instance Variable?