Alshifa Hasnain has Published 283 Articles

Explain quantifiers in Java regular expressions

Alshifa Hasnain

Alshifa Hasnain

Updated on 12-Jun-2025 17:31:35

635 Views

Quantifiers in Java are special characters that allow you to specify the number of times a character or group of characters can occur in a regular expression. The most common quantifiers are: *: One or more ... Read More

When to use the readAllBytes() method of InputStream in Java 9?

Alshifa Hasnain

Alshifa Hasnain

Updated on 12-Jun-2025 16:00:14

10K+ Views

In this article, we will learn to use the readAllBytes() method of InputStream in Java 9. We will get to know the readAllBytes() method with its syntax, then we will learn about the InputStream Class with its methods, and lastly, we will learn the use of readAllBytes() with an ... Read More

How to get dates using LocalDate.datesUntil() method in Java 9?

Alshifa Hasnain

Alshifa Hasnain

Updated on 12-Jun-2025 15:58:17

2K+ Views

In this article, we will learn to get dates using the LocalDate.datesUntil() method in Java 9. We will learn about date ranges, skip or limit results and by using the Period class we will apply the custom steps. What is a LocalDate? LocalDate is a part of java.time package and is ... Read More

How to get all children of a process using Process API in Java 9?

Alshifa Hasnain

Alshifa Hasnain

Updated on 12-Jun-2025 15:53:54

1K+ Views

In this article, we will learn to get all children of a process using Process API in Java 9. First, we will learn about Process API and its methods, ProcessHandle interface and after that we will use the children method of the ProcessHandle interface. Process API In Java, the Process API, we ... Read More

What is the use of the Optional.stream() method in Java 9?

Alshifa Hasnain

Alshifa Hasnain

Updated on 11-Jun-2025 17:28:34

2K+ Views

In this article, we will learn about the use of the Optional.stream() method in Java 9. First, we will learn about the optional class and its method. Then we will see the use cases along with an example.Optional class The Optional class was introduced in Java 8 to reduce the ... Read More

What is the JLink tool in Java 9?

Alshifa Hasnain

Alshifa Hasnain

Updated on 11-Jun-2025 17:27:20

449 Views

What is JLink? Java Linker is a new linker tool that has been used to create our own customized JRE. Usually, we can run our program using default JRE provided by Oracle. If we need to create our own JRE then use this tool. JLink tool can help to create its own ... Read More

How to create scratch variables in JShell in Java 9?

Alshifa Hasnain

Alshifa Hasnain

Updated on 11-Jun-2025 17:24:31

350 Views

JShell is a REPL interactive tool introduced in Java 9 to execute and evaluate simple Java programs like variable declarations, statements, expressions, and programs without using the main() method.In this article, we will learn to create scratch variables in JShell in Java 9. Variables in JShell In Java 9, JShell ... Read More

How to define control flow statements in JShell in Java 9?

Alshifa Hasnain

Alshifa Hasnain

Updated on 11-Jun-2025 13:54:07

358 Views

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 returns output to the user via the command line.  ... Read More

Differences between Optional.ifPresentOrElse() and Optional.or() methods in Java 9?

Alshifa Hasnain

Alshifa Hasnain

Updated on 11-Jun-2025 13:44:57

3K+ Views

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 Class Optional Class is a part of java.util package, and it was introduced in Java 8. It is ... Read More

How to handle an exception in JShell in Java 9?

Alshifa Hasnain

Alshifa Hasnain

Updated on 11-Jun-2025 13:43:05

424 Views

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-line interactive REPL (Read-Evaluate-Print-Loop) tool introduced in ... Read More

Advertisements