a method. It allows adding new methods to existing interfaces without breaking the implementations of classes that implement those interfaces. 53. What is the difference between a BufferedReader and a Scanner? A BufferedReader in Java reads text from a character stream with efficient buffering, while a Scanner can parse different types of data from various sources such as files, strings, or standard input. 54. What is the purpose of the "StringBuilder" class in Java? The "StringBuilder" class in Java is used to create and manipulate mutable sequences of characters. It is more efficient than concatenating strings using the "+" operator, as it avoids unnecessary object creations. 55. What is the difference between the "Comparable" and "Comparator" interfaces? The "Comparable" interface is used to define a natural ordering for a class by implementing the "compareTo()" method. The "Comparator" interface, on the other hand, provides a way to define custom ordering by implementing the "compare()" method and is independent of the class being compared. 56. What is the purpose of the "assert" keyword in Java? The "assert" keyword in Java is used to perform assertions, which are checks placed in the code to verify specific conditions. It is primarily used during development and testing to catch potential bugs or invalid assumptions. 57. What is the difference between a local variable and an instance variable? A local variable in Java is declared inside a method or a block and has a limited scope within that method or block. An instance variable, also known as a member variable, is declared within a class but outside any method and is accessible to all methods of the class. 58. What is the purpose of the "transient" keyword in Java?