0% found this document useful (0 votes)
21 views1 page

Questions

Uploaded by

chinmoyg55
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views1 page

Questions

Uploaded by

chinmoyg55
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

1. What is a Functional Interface in Java 8.

2. Examples around Functional Interfaces (Like Consumer, Supplier, Predicates) → Explain


them little in detail how are the helpful.
3. Write a program to add a sum of numbers using a function interface. Using lambda.
Solution: AddInterface addIns = (a,b) -> Math.add(a, b) ; addIns.add(10,20);
4. Comparator and Comparable differences. Sort a list using streams and filter out few values
and add them using reduce logic (1 line code to do all the above)
5. What is Serialization in java. What is the use of serialVersionId in serialization classes in
java.
6. How do we tell the Java to disable serialization on a POJO attribute.
7. Say that a parent class implemented Serializable, and child has extended Parent. Will child
attributes also be serialized? Answer: Yes (Child Inherits all the properties of Parent)
8. Any other way other than transient key word to disable serialization?
9. Exception → What are checked and unchecked & examples. Should we handle the
exception when a method throwing an error is referenced in another method. (One case
for Checked and one case for Un checked).
10. LinkedList vs ArrayList → Differences. Write a sample logic to find out the best way to get
a middle element from LinkedList.
11. Spring vs Spring Boot. Application Context vs Bean factory and their uses.
12. Jpa vs Hibernate
13. Get vs Load method in Hibernate
14. Write an example, one with JPA and one with JDBCtemplate on how to query an employee
from the Database.
15. Find the 2 / 3/4 th max salary from an employee table generically.
16. Rest Controller → How do you get the entire body of request from UI to backend .
describe the flow in steps.
17. Equals and hashCode play in adding an element to List or Set. Sample code adding a 3
same objects to list and the same to set and determine the size of the collection. What
happens when the Object overrides equals and hashcode method and when it doesn’t .

You might also like