Questions asked to me in Barclays technical round.
1. oops concept detailed with real life examples. 2. Inheritance complete and use of super keyword. 3. what will be the output of the below code. class a{ a(){ System.out.println("Hello a"); } } class b extends a{ b(){ System.out.println("Hello b"); } } class c{ public static void main(String args[]) { a obj1 = new a(); b obj2 = new b(); } } O/P :- Hello a Hello a Hello b Reason : There is a automatic call made to the super constructor. 4. Will the below code compile? class a{ a(int i){ System.out.println("Hello a"); } } class b extends a{ b(){ super(6); System.out.println("Hello b"); } } class c{ public static void main(String args[]) { a obj1 = new a(); b obj2 = new b(); } } Answer : NO Reason : No matching constructor found. 5. Will this code work? class a{ a(){ System.out.println("Hello a"); } } class b extends a{ b(){ System.out.println("Hello b"); } } class...