Java Questions for Practice

Questions for Practice

1. What is the most important feature of Java?
2. What do you mean by platform independence?
3. What is a JVM?
4. What are the supported platforms by Java Programming Language?
5. List any five features of Java?
6. Why is Java Architectural Neutral?
7. Are JVM's platform independent?
8. What is the difference between a JDK and a JVM?
9. What is a pointer and does Java support pointers?
10. What is the base class of all classes?
11. Does Java support multiple inheritance?
12. Is Java a pure object oriented language?
13. What is Polymorphism?
14. What is Abstraction?
15. What is Abstract class?
16. When Abstract methods are used?
17. What is Encapsulation?
18. What is the primary benefit of Encapsulation?
19. Are arrays primitive data types?
20. What are local variables?
21. What are instance variables?
22. How to define a constant variable in Java?
23. What is the return type of the main() method?
24. Why is the main() method declared static ?
25. What is the significance of String arguement of main() method?
26. Can a main() method be overloaded?
27. Can a main() method be declared final?
28. Does the order of public and static declaration matter in main() method?
29. Can a source file contain more than one class declaration?
30. What is a package?
31. Which package is imported by default?
32. Can a class declared as private be accessed outside it's package?
33. Can a class be declared as protected?
34. What is the access scope of a protected method?
35. What is the purpose of declaring a variable as final?
36. What is the impact of declaring a method as final?
37. I don't want my class to be inherited by any other class. What should i do?
38. How Java enabled High Performance?
39. Why Java is considered dynamic?
40. What is JVM and how it is considered in context of Java’s platform independent feature?
41. List two Java IDE’s?
42. What do you mean by Object?
43. Define class?
44. What kind of variables a class can consist of?
45. What is Singleton class?
46. What do you mean by Constructor?
47. List the three steps for creating an Object for a class?
48. What is the default value of byte datatype in Java?
49. What is the default value of float and double datatype in Java?
50. When a byte datatype is used?
51. What is a static variable?
52. According to Java Operator precedence, which operator is considered to be with highest precedence?
53. Variables used in a switch statement can be used with which datatypes?
54. What is the use of parseInt() method can be used?
55. Why is String class considered immutable?
56. Why is StringBuffer called mutable?
57. What is the difference between StringBuffer and StringBuilder class?
58. What is finalize() method?
59. What is an Exception?
60. What do you mean by Checked Exceptions?
61. Explain Runtime Exceptions?
62. Which are the two subclasses under Exception class?
63. When throws keyword is used?
64. When throw keyword is used?
65. How finally used under Exception Handling?
66. What things should be kept in mind while creating your own exceptions in Java?
67. Define Inheritance?
68. When super keyword is used?
69. What is an Interface?
70. Give some features of Interface?
71. What is the use of Packages in java?
72. What do you mean by Multithreaded program?
73. What are the two ways in which Thread can be created?
74. What is an Applet?
75. An applet extend which class?
76. Explain garbage collection in Java?
77. Explain the usage of this() with constructors?
78. Explain the following line used under Java Program − public static void main (String args[ ])
79. Define JRE i.e. Java Runtime Environment?
80. What is JIT compiler?
81. What is the purpose of default constructor?
82. Can a constructor be made final?
83. What is static block ?
84. Define composition?
85. What is function overloading?
86. What is function overriding?
87. Difference between Overloading and Overriding?
88. What is final class?
89. What is NullPointerException?
90. What are the ways in which a thread can enter the waiting state?
91. How does multi-threading take place on a computer with a single CPU?
92. What invokes a thread's run() method?
93. Does it matter in what order catch statements for FileNotFoundException and IOException are written?
94. What are Wrapper classes?
95. What is the difference between the paint() and repaint() methods?
96. What is the difference between a break statement and a continue statement?
97. If a variable is declared as private, where may the variable be accessed?
98. What is the purpose of the System class?
99. List primitive Java types?
100. Can try statements be nested?
101. Explain JVM architecture?
102. What are Class Loaders?
103. What is the difference between an Interface and an Abstract class?
104. What will happen if static modifier is removed from the signature of the main method?
105. What is the default value of an object reference declared as an instance variable?
106. Can a top level class be private or protected?
107. Why do we need wrapper classes?
108. What is the difference between error and an exception?
109. Is it necessary that each try block must be followed by a catch block?
110. When a thread is created and started, what is its initial state?
111. What are synchronized methods and synchronized statements?
112. What is runtime polymorphism or dynamic method dispatch?
113. Can constructor be inherited?
114. What are the advantages of ArrayList over arrays?
115. Why deletion in LinkedList is fast than ArrayList?
116. How do you decide when to use ArrayList and LinkedList?
117. What is a Values Collection View ?
118. What is dot operator?
119. Where and how can you use a private constructor?
120. What is type casting?
121. Describe life cycle of thread?
122. What is the difference between the >> and >>> operators?
123. Which method of the Component class is used to set the position and size of a component?
124. What is the range of the short type?
125. What is the immediate superclass of Menu?
126. Does Java allow Default Arguments?
127. Break statement can be used as labels in Java?
128. Where import statement is used in a Java program?
129. Explain suspend() method under Thread class>
130. Explain isAlive() method under Thread class?
131. What is currentThread()?
132. Explain main thread under Thread class execution?
133. Life cycle of an applet includes which steps?
134. Why is the role of init() method under applets?
135. Which method is called by Applet class to load an image?
136. Define code as an attribute of Applet?
137. How does a try statement determine which catch clause should be used to handle an exception?
138. What will be the default values of all the elements of an array defined as an instance variable?





Visit My Blog: http://vinay-kumar-saini.blogspot.in/

No comments:

Post a Comment