Java


Java Short Questions for 1 Marks
  1. Difference between Abstract and Concrete Class ?
  2. Difference between Overloading and Overriding ?
  3. Types of Inner classes ?
  4. Difference between TreeMap and HashMap ?
  5. Difference between List , Sets and Maps ?
  6. Difference between Private , Public and Protected ?
  7. What is role of Synchronization in Java ?
  8. What is Default Access ?
  9. Difference between Vector and ArrayList ?
  10. Difference between class and objects ?
  11. Describe Garbage Collection in Java ?
  12. What are the types of Polymorphism in Java ?
  13. Different ways of using threads ?
  14. Difference between Composition and Inheritence ?
  15. What are Static variables ?
  16. Difference between Interfaces and Abstract classes ?
  17. Explain Constructor ?
  18. What is Dynamic Binding ?
  19. What is the use of Volatile Keyword ?
  20. Explain Serialization ?
  21. What is the use of Transient Keyword ?
  22. What are Static Methods ?
  23. What is a Final variable ?
  24. What is a Final Method ?
  25. What is a Final Class ?
  26. What is an Immutable Object ?
  27. Difference between checked and unchecked exceptions ?
  28. Give an Example of checked and unchecked exception ?
  29. Can a class extend an interface ?
  30. Does Java support multiple inheritence ?
  31. What do you mean by return type Void  ?
  32. Is Java Compiled or an Interpreted language ?
  33. What is a class file ?
  34. Why Java is a called a platform independent language ?
  35. Explain the use of "Native" keyword ?
  36. What is "super" used for ?
  37. What is "this" keyword used for ?
  38. What is the default value of local variable ?
  39. What will happen if we declare a class abstract as well as final ?
  40. What is Encapsulation ?
  41. Explain Inheritence ?
  42. Explain Polymorphism ?
  43. Difference between assignment and initialization ?
  44. Difference between boolean and Boolean ?
  45. What is an Immutable object ?
  46. Give an example of immutable class ?
  47. What is Casting ?
  48. Explain Finalize () ?
  49. What are Marker Interfaces ?
  50. Difference between String and StringBuffer ?
  51. Difference between Process and Thread ?
  52. Explain Thread states ?
  53. What is a Deadlock ?
  54. Difference between Serialization and Deserialization ?
  55. Difference between Java 1.4 and Java 5 ?
  56. Explain Autoboxing ?
  57. What are Wrapper Classes ?
  58. What are Primitive Wrapper Classes ?
  59. What is automatic conversion of primitive data type to its Wrapper class called ?
  60. What is "Import" used for ?
  61. Difference between HashMap and HashTable ?
  62. What is an Iterator ?
  63. What is JVM ?
  64. What is JDK ?
  65. What is JRE ?
  66. Different types of memory used by JVM ?
  67. What is a Class Loader ?
  68. Does Static Public Void instead of Public static Void gives compilation error ?
  69. Does constructor returns any value ?
  70. Can we make constructor final ?
  71. Why main method is static ?
  72. What is a Static Block ?
  73. Can we overload main method ?
  74. Can we declare main method as final ?
  75. What is Static binding ?
  76. What is Dynamic Binding ?
  77. Can we declare an interface method static ?
  78. Can an interface be final ?
  79. Can we declare interface methods as private ?
  80. What is a Static import ?
  81. Base class for Error and Exceptions ?
  82. Difference between StringBuffer and StringBuilder ?
  83. Default Package for Collection classes ?
  84. Difference between List and Queue ?
  85. Difference between Vector and ArrayList ?
  86. Which is the base interface for all collection classes ?
  87. What are concepts introduced with Java 5 ?
  88. Difference between C++ and Java ?
  89. Can we override static methods ?
  90. What precaution should be used while dealing with static variables ?
  91. Can we override main method ?
  92. Difference between sleep and wait ? 
  93. Name Wrapper classes available for primitive types ?
  94. Explain System.out.println ?
  95. Explain public static void main() ?
  96. What is Java Byte Code ?
  97. What is the relation between class file and byte code ?
  98. How can we make the object immutable ?
  99. What is the purpose of making an object immutable ?
  100. Explain the scenerios to choose between String , StringBuilder and StringBuffer ?
  101. Explain java.lang.OutOfMemoryError ?>
  102. Difference between arraylist and linkedlist ?
  103. Difference between implicit and explicit type casting ?
  104. Can we have an abstract class without abstract methods ?
  105. Can we have abstract methods in a class which is not Abstract ?
  106. Array list , Map and Set Classes or Interfaces ?
  107. Difference between .equals and == ?
  108. What are the methods of Object class ?
  109. What are the class loaders ?
  110. What are the different class loaders used by JVM ?
  111. Have you ever destroyed objects yourself ?
  112. Should we override finalize method ?
  113. Will finally be executed for handled or unhandled exceptions ?
  114. Difference between protected and default Modifier ?
  115. Can we overload methods on a single parameter with data types as int and long. For example int calculate(int x) and int calculate(long x)  ?
  116. What is keyword instanceOf used for ?
  117. If we obj is an object of Class A and Class A extends Class B , What will obj instanceof B will return ?
  118. What is assert keyword used for ?
  119. What is the default value for Object Reference in Java ?
  120. What is a Default Constructor ?
  121. Will Compiler creates a default no argument constructor if we specify only multi argument constructor ?
  122. What will happen if we make the constructor private ?
  123. How can we create objects if we make the constructor private ?
  124. Is that the only way to initialize the object in that case ?
  125. Is constructor inherited ?
  126. What will happen if we remove the static keyword from main method ?
  127. Which is the super class of all classes in java ?
  128. Why Java don't use pointers ?
  129. Can we use both "this" and "super" in a constructor ?
  130. Can we achieve runtime polymorphism by data members ?
  131. Do we need to import java.lang.package ?
  132. Can i import same package / class twice ?
  133. Is it necessary that each try block to be followed by catch block ?
  134. Can finally block be used without catch ?
  135. Can an exception be rethrown ?
  136. What is exception propagation ?
  137. What is the use of toString method ?
  138. Difference between nested and inner classes ?
  139. What is a nested interface ?
  140. Can an unreferenced object be referenced again ?
  141. What kind of thread is garbage collector thread ?
  142. What is an Externalizable interface ?
  143. Difference between serializable and externalizable interface ?
  144. What is the purpose of System Class ?
  145. What is Locale ?
  146. Situations where "this" keyword can be used?
  147. Can we declare interface method's private?
  148. What is the problem with following code?
  149. Can we instantiate the object of derived class if parent constructor is protected ?
  150. Can we declare an abstract method private ?
  151. Can Abstract methods in parent class have a body ?
  152. Can we declare a class static ?
  153. Can we reduce the visibility of the overridden method ?
  154. Can we make an object final i.e immutable using final keyword ?
  155. What are the design considerations while making a choice between using interface and abstract class ?
  156. What are new features introduced with Java 8?
  157. What is a Lambda Expression ? What's its use ?
  158. Can we have a default method definition in the interface without specifying the keyword "default" ? 
  159. Can we use static method definitions in Interfaces ?
  160. Can we access Interface static method using Interface references ?
  161. What is the difference between Data Type and Data Structure ?
  162. Is it correct to say that Interfaces are abstract data types ?
  163. Which sorting algorithm is used by Collections.sort() in Java ?

No comments:

Post a Comment