Tag: Object Oriented Programming
- What is the purpose of using Optional.ifPresentOrElse() method in Java 9?In this article, we will learn about the purpose of using the Optional.ifPresentOrElse() method in Java 9.,%? The Optional Class The Optional class was introduced in Java 8. Many Java developers face null pointer exceptions to avoid this, we need to pu
- How to handle an exception in JShell in Java 9?In this article, we will learn to handle an exception in JShell in Java 9. We will learn about the JShell, exceptions in Java, JShell exceptions, their handling, and Types of exceptions in JShell with examples. What is JShell? JShell is a new command
- Differences between Optional.ifPresentOrElse() and Optional.or() methods in Java 9?In this article, we will learn about the differences between Optional.ifPresentOrElse() and Optional.or() methods in Java 9. Both Optional.ifPresentOrElse() and Optional.or() methods were introduced in Java 9 to improve its functionality. Optional Cl
- What are the characteristics of a module in Java 9?The module is a collection of code, data, and resources. It is a set of related packages and types like classes, abstract classes, and interfaces w
- What are the benefits of a module in Java 9?An important feature introduced in Java 9 is Module. By using a module, we can divide the code into smaller components called modules. It means each module has its own responsibility and declare its dependency on
- How to define control flow statements in JShell in Java 9?In this article, we will learn about the control flow statements in JShell in Java. JShell is a new interactive command-line tool introduced in Java 9. This tool can also be called REPL (Read-Eval-Print-Loop) because it takes input, evaluates it, and