Assignment 3
Q1. Explain Functional Interfaces and Lambda Expressions in Java. Write a
program to demonstrate a lambda expression for sorting a list of integers.
Q2. What are Streams in Java? Write a program using Stream API to:
Filter even numbers
Find the sum of all numbers in a list
Q3. Explain Method References and Default Methods with examples.
Differentiate between method reference and lambda expression.
Q4. Discuss the following Java features with examples:
Try-with-resources
Switch Expressions
Records and Sealed Classes
Assignment 4
Q1. Explain the Collection Framework hierarchy in Java. Differentiate
between:
List
Set
Map
Q2. Write a Java program to demonstrate:
ArrayList
LinkedList
Also compare their performance.