Raja has Published 469 Articles

What is Http/2 Client in Java 9?

raja

raja

Updated on 13-Mar-2020 08:52:38

509 Views

Http/2 Client API introduced in Java 9. It has more performance improvements over Http/1.1 and also supports server-side push events. This makes the website efficient and faster to browse. Http/2 Client is an incubator module named jdk.incubator.httpclient, which means that all features are still not finalized, and new changes may come in future versions of java. It ... Read More

How to debug JShell in Java 9?

raja

raja

Updated on 13-Mar-2020 07:05:27

415 Views

JShell is a REPL tool that allows snippets of code to be run without placing them in classes. This tool provides a way to evaluate declarations, statements, and expressions in Java and no need to create the main() method to test some parts of the code.The command "/debug" can be used to display ... Read More

What is New Versioning Scheme in Java 9?

raja

raja

Updated on 12-Mar-2020 08:15:26

629 Views

Since Java 9, versioning can be consistent with semantic versioning. The version number can be a non-empty sequence of strings separated by dots. It contains three major parts: major version number, minor version number, and security. The new versioning scheme has documented in Runtime. Version class and version information can be accessed ... Read More

How to print different stack frames using StackWalker API in Java?

raja

raja

Updated on 11-Mar-2020 07:26:27

303 Views

Java 9 defines a StackWalker API that provides laziness and frame filtering. An object of StackWalker allows us to traverse and access stacks and contains one useful method: walk(). This method opens a StackFrame stream for the current thread, then applies the function with that StackFrame stream. We need to get StackWalker object, then use StackWalker.getInstance() method.In the ... Read More

How can we implement the SubmissionPublisher class in Java 9?

raja

raja

Updated on 09-Mar-2020 09:45:11

885 Views

Since Java 9, we can create Reactive Streams by introducing four core interfaces: Publisher, Subscriber, Subscription, Processor, and one concrete class: SubmissionPublisher that implements the Publisher interface. Each interface plays a different role, corresponding to the principles of Reactive Streams. We can use the submit() method of SubmissionPublisher class to publish the provided item ... Read More

What are the core interfaces of Reactive Streams in Java 9?

raja

raja

Updated on 09-Mar-2020 06:36:32

741 Views

Java 9 has introduced Reactive Streams under java.util.concurrent.Flow package that supports an interoperable publish-subscribe framework. It processes an asynchronous stream of data across the asynchronous boundary (passing elements into another thread or thread-pool), and the receiving side is not forced to buffer arbitrary amounts of data, then buffer overflow can't occur.Flow ... Read More

How to retrieve all processes data of Process API in Java 9?

raja

raja

Updated on 09-Mar-2020 05:36:55

806 Views

In Java 9, Process API has been used to control and manage operating system processes. ProcessHandle class provides the process’s native process ID, start time, accumulated CPU time, arguments, command, user, parent process, and descendants. It also provides a method to check processes liveness and to destroy processes. We retrieve all ProcessHandle data as a stream by using the allProcesses() ... Read More

How to terminate/destroy a process using Process API in Java 9?

raja

raja

Updated on 06-Mar-2020 12:28:44

1K+ Views

In Java 9, Process API supports an easy way to get much information about a process. ProcessHandle interface can identify and provide the control of native processes and method to check processes liveness and destroy the processes whereas ProcessHandle.Info interface can give an Information snapshot of a process. We need to ... Read More

Importance of ofInstant() method in Java 9?

raja

raja

Updated on 06-Mar-2020 10:35:54

217 Views

In Java 9, the ofInstant() method has introduced for conversion. It is a static method of LocalDate, LocalTime, and LocalDateTime classes. This method converts java.time.Instant object to LocalDate that requires a time zone in the form of java.time.ZoneId.Syntaxpublic static LocalTime ofInstant(Instant instant, ZoneId zone) public static LocalDate ofInstant(Instant instant, ZoneId ... Read More

What are the enhancements in Internationalization in Java 9?

raja

raja

Updated on 06-Mar-2020 07:32:25

154 Views

Internationalization enhancements in Java 9 include Unicode 8.0, UTF-8 properties files and enabling CLDR locale data by default. Java 9 supports up to Unicode 8.0 standards with 10, 555 characters, 29 scripts, and 42 blocks.In Java 9, the properties files are loaded in UTF-8 encoding. By default, reading an input stream ... Read More

Advertisements