1. What is right syntax of for loop declaration?
a. declaration ; initialization ; condition ; increment/decrement
b. declaration initialization ; condition ; increment/decrement
c. declaration initialization ; condition ; increment ; decrement
d. declaration ; initialization condition ; increment/decrement
2. Which keyword skips the current iteration of a loop
3. Which keyword terminates the loop iteration
4. Which access specifier is applicable to all the class instance variables by default?
5. Which access specifier members/methods can be accessible by instance method of a class?
6. Which access specifier members/methods a class method can accessible?
7. Which modifier is prefixed to class by default?
8. Which modifier is prefixed to interface by default?
9. Which variables are need to be initialized at the time of declaration?
10. Which value is assigned to static only variable by default?
11. Which value is assigned to static final variable by default?
12. Interface method need to declared as abstract. Say Y/N?
13. Interface variables static transient by default. Say Y/N?
14. Is local variables can be declared as final. Say Y/N?
15. Is local variables can be declared as static. Say Y/N?
16. Can we apply access specifier to local variables. Say Y/N?
17. Why some times super classes are declared as abstract?
18. What if class is declared as final instead of declaring all its variables as final?
19. What is Runtime Polymorphism?
20. Which OOP features helps to implement Runtime Polymorphism?
21. What if array is passed as argument in method, is it a pass-by-value or pass-by-reference?
22. Why interface need be implemented to a class when there are no method implementations, only declaration exist?
23. How to differentiate class instance variables from constructor parameters?
24. Is default constructor is generated if we write a constructor?
25. What values are initialized to class instance variables when we don’t initialize them in the constructor?
26. What is the default access specifier applied to constructor if we don’t specify any access specifier to constructor?
27. Is static inner class can contain both static and non-static methods?
28. Is non-static inner class can contain both static and non-static methods?
29. How to access non-static method of a static inner class?
30. How to find the length of an array?
31. How to find the length of an String?
32. In pass by value is the passed value is changed when the argument in method changes?
33. In pass by reference is the passed reference is changed when the argument in method changes?
34. Which variable will not have instance memory of a class?
35. When static blocks executes?
36. Is static method executes when class is loaded?
37. What happens to statements written in a non-static block?
38. What is the other name of a non-static block?
39. What happens if class constructor is declared as private?
40. What happens if class constructor is declared as default?
41. What happens if class constructor is declared as protected?
42. What happens if class constructor is declared as public?
43. Which are valid main() method?
a. public static void main(String rags)
b. static public void main(String rags)
c. public static void main(String rags)
d. public void main(String rags)
e. public static void main(String rags)
f. public static void main(String… rags)
g. public static void main(String rags…)
44. What is the last index of a command line argument if the command line arguments are 10?
45. What happens if we access more than the last index of a command line argument?
46. Is Thread.sleep() methods reports checked exception or unchecked exception?
47. What are Exception sub classes?
48. What are RuntimeException sub classes?
49. Which exceptions need to caught/declare to be thrown?
50. What happens to the program execution if an unchecked exception raises and is not handled?
51. How to terminate the program execution when exception is raised and caught?
52. What happens to if double value is assigned to float?
53. What are important methods in StringBuffer class?
54. Is replace method exist in String, if exist what is it’s the parameter?
55. What happens in StringBuffer if the length increases more than its initial capacity?
56. How to increase the capacity of a StringBuffer?
57. What happens when setLength() method is called on StringBuffer?
58. How to remove leading and trailing space in String?
59. What happens if two String are compared using == operator?
60. What happens if two String are compared using equals() method?
61. Which operator is used to compare primitive datatype variables?
62. When to use IS-A and when to use HAS-A?
63. Is private, static can be applied on a variable?
64. Is default, static can be applied on variable? If so up-to which scope we can access it?
65. Is protected, static can be applied on variable? If so up-to which scope we can access it?
66. Is public, static can be applied on variable? If so up-to which scope we can access it?
67. Why public class name and the .java file name must be same?
68. Is private methods can be overridden?
69. Is default methods can be overridden?
70. Is protected methods can be overridden?
71. Is public methods can be overridden?
72. Write an example on abstraction to achieve Runtime Polymorphism?
73. Tell me remembered java keywords.
74. Tell me all access specifiers and access modifiers in a brief way.
75. List Arithmetic Operators
76. List Relational Operators
77. List Bitwise Operators
78. List Logical Operators
79. List Assignment Operators
80. List Prefix, Postfix Operators
81. List Shift Operators
82. Explain Ternary Operator
83. Where you can use ‘case’ and ‘default’ keywords and tell one more keyword missing keyword?
84. To implement Thread from which class/interface we need inherit from?
85. Which method we need to implement to implement Thread logic?
86. Which method delays thread execution for finite amount of time?
87. How to name thread?
88. How to retrieve thread name?
89. How to set Thread priority?
90. State Thread priorities?
91. Which keyword is used to synchronize threads?
92. How to apply thread synchronization?
93. How to apply object synchronization?
94. What yield method does?
95. On what basis how many threads are required in our project?
96. What is the essential method in InputStream?
97. What is the essential method in OutputStream?
98. Which InputStream class is used to read files?
99. What InputStream class read() method returns?
100. What indicates that the stream reaches to end?
101. Which InputStream class reads line-by-line?
102. Which InputStream class reads buffer-by-buffer?
103. Which OutputStream sub class is used often to perform write operations?
104. Which OutputStream class object exist in System class to perform write operations?
105. What is difference between InputStream, OutputStream classes and Reader, Writer?
106. Which class is used to perform Socket operations on server side?
107. Which class is used to perform Socket operations on client side?
108. Which method of ServerSocket class receives client’s socket request?
109. Which classes are used to perform User Datagram Protocol operations?
110. State the classes legacy API in java.utl package?
111. What is the super class of Hashtable class?
112. What is the super class of Properties class?
113. What is the difference in Hashtable and Properties classes?
114. List the methods of Vector class?
115. Name the Vector sub class?
116. Vector class performs FIFO/LIFO?
117. Stack class performs FIFO/LIFO?
118. Which method of Vector class returns all the elements?
119. What is its return type?
120. What is limitation of legacy classes?
121. How util package classes are advantageous than Arrays?
122. List the Vector class methods?
123. List the Hashtable class methods?
124. List the Properties class methods?
125. What is super interface of Collection API?
126. Which classes comes under Collection hierarchy?
127. Which class in List interface is often used?
128. Which method of List is used to return all the elements?
129. Which interface is used to perform reverse iterate operations?
130. What is the difference between List and Set
131. Specify the difference in List and Set interface methods?
132. Specify List sub classes?
133. Specify Set sub classes?
134. Which Set classes performs unique-no order, unique-given order, unique-natural order?
135. What are Map sub classes?
136. Which Map classes performs unique-no order, unique-given order, unique-natural order?
137. Which sub classes can be added to TreeSet and TreeMap?
138. Difference between Comparable and Comparator interface methods?
139. What is the difference between Legacy classes and Collection classes?
140. Difference between peek() and poll() methods?
141. Difference between peekLast() and pollLast() methods?
142. To which class peek() and poll() methods belong to?
143. What happens if Thread class run() method is called?
144. Which method in Thread class starts run() method?
145. What addShutdownHook(Thread) performs?