HashMaps. 47. What is the difference between a shallow copy and a deep copy? A shallow copy creates a new object that shares the same references as the original object, while a deep copy creates a new object and recursively copies all the referenced objects as well, resulting in separate copies. 48. What is a lambda expression in Java? A lambda expression in Java is an anonymous function that can be used to simplify the syntax of functional interfaces. It allows for more concise and readable code, especially when working with functional programming constructs. 49. What is functional programming in Java? Functional programming in Java is a programming paradigm that emphasizes writing programs using pure functions and immutable data. It involves treating functions as first-class citizens and utilizing higher-order functions and lambda expressions. 50. What are the Java 8 features for functional programming? Java 8 introduced several features to support functional programming, including lambda expressions, functional interfaces, the Stream API for working with collections, and default methods in interfaces. 51. What is the difference between an interface and an abstract class? An interface in Java can only declare method signatures and constants but cannot provide implementations, while an abstract class can have both method declarations
and concrete implementations. A class can implement multiple interfaces but can inherit from only one abstract class. 52. What is the purpose of the "default" keyword in interface methods? The "default" keyword in Java interfaces is used to define a default implementation for