What is the difference between exception and error?- The exception class defines mild error conditions that your program encounters. What is the difference between Array and vector?- Array is a set of related data type and static whereas vector is a growable array of objects and dynamic. b) String class supports constant strings whereas StringBuffer class supports growable and modifiable strings. What is the difference between String and String Buffer?- a) String objects are constants and immutable whereas StringBuffer objects are not. What is the difference between superclass and subclass?- A super class is a class that is inherited whereas sub class is a class that does the inheriting. What is the difference between this() and super()?- this() can be used to invoke a constructor of the same class whereas super() can be used to invoke a super class constructor. d) Overloading must have different method signatures whereas overriding must have same signature. c) In overloading, separate methods share the same name whereas in overriding, subclass method replaces the superclass. b) Overloading does not block inheritance from the superclass whereas overriding blocks inheritance from the superclass. What is the difference between overloading and overriding?- a) In overloading, there is a relationship between methods available in the same class whereas in overriding, there is relationship between a superclass method and subclass method. While using those methods, values passed to those variables are called arguments. What is the difference between an argument and a parameter?- While defining method, variables passed in the method are called parameters. What is the difference between constructor and method?- Constructor will be automatically invoked when an object is created whereas method has to be called explicitly. What is the difference between Assignment and Initialization?- Assignment can be done as many times as desired whereas initialization can be done only once. b) In procedural program, data is exposed to the whole program whereas in OOPs program, it is accessible with in the object and which in turn assures the security of the code. In OOP program, unit of program is object, which is nothing but combination of data and code. What is the difference between procedural and object-oriented programs?- a) In procedural program, programming logic follows certain procedures and the instructions are executed one after another. JAVA Common Interview Quest ions and Answers