Thursday, August 27, 2015

Only Java interview questions.....



Q. What are the JAVA 5 features ?

Q. What are the JAVA 8 features ?

Q. What are JSP implicit objects?

Q. Write a program to print triangle star.

Q. Write a program to calculate the angle between hour hand and minute hand
 (hint: http://www.geeksforgeeks.org/calculate-angle-hour-hand-minute-hand/)

Q. Cyclic inheritance in java possible or not ?

Q. JVM,JRE and JDK

Q. difference between '==' and equals() in java

Q. is servlet is thread safe? How you will make thread safe servlet ?

Q. SingleThreadedModel in java?

Q. Difference between servlet and jsp?

Q. Difference between servlet and struts?

Q. How struts life cyle?

Q. Servlet life cycle?

Q. JSP life cycle?

Q. transient, volatile keyword?

Q. Arraylist travelling ways in java?

Q. serialization interface in java?

Q. how forward to jsp from servlet?

Q. private constructor in java ?

Q. how parse integer value from string example Integer.parseInt("123") any other way to do this ?

Q. difference between hashTable and HashMap

Q. difference between servletConfig and servletContext

Q. difference between fail safe and fail fast iterator in java

Q. difference between Iterator and Enumerator in java?

Q. print collection using iterator and enumerator.

Q. difference between iterator and for each loop to iterate a collection.

Q. difference between comparator and comparable interface.

Q. when ConcurrenModificationException will come ?

Q. page versus pageContext in jsp

Q. page scope in jsp

Q. how deadlock will come in java program ? how to resolve that ?

Q. how you will handle exception in java? (try, catch and finally)

Q. What is use of finally and without catch can we use finally block?

Q. what is POJO class and what is significance of it?

Q. method overloading and overriding ?

Q. can we override final method?

Q. can we overload final method?

Q static method - overloading and overriding

Q. can you overload main method?

Q can you override main method?

Q. How Jdk 1.4 is differ from jdk 1.6 in terms of overriding (covariant return type feature in jdk 1.6)

Q. Difference between ArrayList and LinkedList?

Q. What is hashing, hashcode?

Q. explain internal implementation of hashmap?

Q. difference between interface and abstract class.

Q. in exception handling - how to avoid finally block execution (ans- using system.exit() we can avoid finally block execution)

Q. Exception hierarchy in java- super class in exception hierarchy ?

Q. Difference between checked and unchecked exception with examples.

Q. Write a program for prime number.

Q. Reverse string program without in built function and complexity should be O(n/2)

Q. collection API hierarchy in java.

Q. difference between sendRedirect and forward in servlet.

Q. Design patterns in java.

Q. Java thread class- list all static method of thread class.

Q. different types to create thread in java.

Q. Future Interface in java.

Q. difference between GET and POST

Q. ArratList v/s Set

Q. ArrayList v/s Array

Q. Vector v/s Arraylist

Q. List interface - ArrayList, Vector, LinkedList

Q. Implement a stack program in java

Q. implement Linked List program in java

Tuesday, August 18, 2015

Q. What are the method of Object class.
Ans.
Clone()
equals()
finalize()
getClass()
hashCode()
notify()
notifyAll()
wait()

Sunday, August 16, 2015



Q. What are the OOPS features-
Ans.- Encapsulation, Inheritance, Abstraction, Polymorphism

Q. What is difference between String and StringBuffer-
Ans. String is immutable and StringBuffer is mutable class
        When perform operations on string object, it will create new object, but in case of stringbuffer its will use same instance without creating new object.

Q. Difference between String declaration - String s1="string"; and String s=new String("string");
Ans. First one will create string in string pool and second will create the string object in hash memory.

Q. StringBuffer and StringBuilder
Ans.- StringBuffer and StringBuilder both are mutable
          StringBuffer are having synchronize method and StringBuilder doesn't have any synchonized method.
          StringBuffer are thread safe. StringBuilder are thread unsafe