Tag: Object Oriented Programming
- What are the new methods added to an Optional class in Java 9?An Optional class provides a container that may or may not contain a non-null value. This Optional class introduced in Java 8 to reduce the number of places in the code where a NullPointerExc
- What are the new features added to Stream API in Java 9?In Java 9, Oracle Corporation has added four useful new methods to Stream API. Those methods are iterate(), ofNullable(), takeWhile() and dropWhile(
- Can a diamond operator be used with an anonymous inner class in Java 9?Yes, we can use the diamond operator with an anonymous inner class since Java 9.The purpose of using a diamond operator is to avoid redundant code and make it mo
- What is the use of underscore keyword in Java 9?In earlier versions of Java, the underscore ("_") has used as an identifier or to create a variable name. Since Java 9, the unders
- @SafeVarargs annotation for private methods in Java 9?The @SafeVarargs annotation was introduced in Java 7. This annotation applies to both final and static methods or constructors that take
- What are the CompletableFuture API improvements in Java 9?\\nCompletableFuture API is used for asynchronous programming in Java. It means that we can write non-blocking code by running a task on