Pergunta de entrevista da empresa Infosys

1. Diff b/w Abstract & Interface? 2.Class cannot override any other class? how? 3.Integer a = new Integer(null); What will be the o/p? 4.Diff b/w throw & throws? 5.Write a program reverse a string without using reverse function? 6.Write a program to remove duplicate element in a list by java program? 7.Dependency Injection 8.First level cache & Second level Cache in Spring 9.Overriding method with program 10.Sort the salary in Emp table by using Comparable 11.Name of hibernate configuration file 12.Singleton Example 13. Exception catch{} finally{} works without using try {} 14. SQL Query...

Resposta da entrevista

Sigiloso

11 de mar. de 2016

2.Use final for class declaration. 3.NumberFormatException - accepts only String and int . String in the form of int value 4. throw - can use to throw exception explicitly, throws - used to propagate the exception 6. Iterate the List and add into Set(HashSet) to remove the duplicates 10.@Override public int compareTo(Object o) { // TODO Auto-generated method stub ComparableSorting e = (ComparableSorting) o; if(this.employee_id > e.employee_id){ return 1; }else{ return -1; } } 11.mapping tag in hibernate session configuration file. 12.Logger 13.yes works

1