UNIT-3: JAVA NEW FEATURES (AKTU QUICK NOTES)
1. Functional Interface: One abstract method. Used in lambda.
Example: A obj = () -> [Link]('Hello');
2. Lambda Expression: Shortcut function → (a,b) -> a+b
3. Method Reference: Class::method (e.g., Integer::parseInt)
4. Default Method: Can have body in interface
Static Method: Called using Interface name
5. Stream API: Process data
Example: [Link]().filter(x->x%2==0).forEach([Link]::println);
6. Base64: Encode/Decode data
7. forEach: [Link](x->[Link](x));
8. Try-with-resources: Auto close resources
9. Type Annotation: Used on types
10. Repeating Annotation: Same annotation multiple times
11. Module System: [Link]
12. Diamond Operator: new ArrayList<>()
13. var: Auto type detection
14. Switch Expression: case -> value
15. Text Block: """ multi-line string """
16. Records: record Student(String name,int age){}
17. Sealed Class: sealed class A permits B,C{}