Monday, March 19, 2012

More Core Java Interview Question for experienced Developers

Q 1) Does StringBuffer always give better performance then concatenation using + ? In which case StringBuffer will give better performance then concatenation using +?

Q2) How does garbage collector decide which objects are to be removed? Can garbage collector be forced?

Q3) What is the difference between an argument and a parameter?

Q4) What are wrapper classes?

Q5) What is difference between Collections and Collection?

Q6) What is connection pooling and what are the advantages of connection pooling?

Q7) What is Servlet?

Q8) What exactly is “Code once and run anywhere” property of Java? How does Java achieve this behavior?

Q9) What happens when we run this code?
class Test {   public static void main(String args[]) {
    ArrayList alist = new ArrayList();     alist.add(new String("A"));     alist.add(new String("B"));     alist.add(new String("C"));      int i = 0;      for (Iterator it = alist.iterator(); it.hasNext(); ) {       System.out.println(alist.get(i++));     }   } }
Q10) 


No comments:

Post a Comment

Spring Boot Config Server and Config Client.

 In Spring cloud config we can externalise our configuration files to some repository like GIT HUT, Amazon S3 etc. Benefit of externalising ...