Java Interview Question

1.Can we access instance variables within static methods ?

2.Difference between shallow cloning and deep cloning of objects?

3.What happens if one of the members in a class does not implement Serializable interface?
 
4.How garbage collector knows that the object is not in use and needs to be removed?

5.What is daemon thread?
  
6.What is the difference between a REST web service and a SOAP web service?
 
7. Difference between @Secured vs @RolesAllowed vs @PreAuthorize in Spring Security?

8.Explain the RowCallbackHandler in Spring?
 
9.What are the differences between forward() and sendRedirect() methods in Servlet?
 
10.How to execute stored procedure in hibernate

11.Write a Java program to remove duplicate elements from an arraylist without using collections (without using set)

12.Write a program to convert a string array to arraylist?

13.Write a program for Bubble Sort in java.

14.Write a program to get a line with max word count from the given file?

15.Write a program to sort a Stack using a temporary Stack?

16.Write a simple program for CallableStatement statement to execute stored procedure?.

17.Write a program to reverse a string using recursive algorithm?

18.Write a program to find longest substring without repeating characters?

19.Write a program to get file list from a folder filtered by extensions?


20.What is the difference between the LIKE and REGEXP operators with example in MySQL?

Comments

Popular posts from this blog

JPA JPQL advantages and disadvantage

Java8 Collectors mapping and joining function usages