Raja has Published 760 Articles

How can we create a multi-release jar(mrjar) using jar tool in Java 9?

raja

raja

Updated on 01-Apr-2020 16:29:09

158 Views

In Java 9, a new feature "multi-release jar format" has been introduced where jar format enhanced with different versions of Java class or resources that can be maintained and used as per the platform. A jar command can be used to create a multi-release jar that contains two versions of ... Read More

How to check a string is palindrome or not in Jshell in Java 9?

raja

raja

Updated on 01-Apr-2020 15:47:43

110 Views

JShell is the first REPL(Read-Evaluate-Print-Loop) interactive tool that has been introduced as a part of Java 9. It evaluates declarations, statements, and expressions as entered and immediately shows the results, and it runs from the command-line prompt.Palindrome string is a string where it remains the same when reversed or word spelled the same ... Read More

What are the core library changes in Process API in Java 9?

raja

raja

Updated on 01-Apr-2020 10:01:49

88 Views

In Java 9, one can retrieve the PID of the process through a native call and can be achievable through the ProcessHandle. We can also retrieve information about the currently running Java Process (JVM) and Info (inner class of ProcessHandle) class that contains details about the process. We can also return a ... Read More

Which modifiers can't allow in the top-level declaration in JShell in Java 9?

raja

raja

Updated on 01-Apr-2020 07:52:42

122 Views

JShell is an interactive tool for learning the Java language and prototyping Java code. It is a REPL (Read-Evaluate-Print-Loop) that evaluates declarations, statements, and expressions once entered and immediately prints the results in JShell. This tool runs from the command-line prompt.The modifiers like public, protected, private, static, and final have not allowed on top-level declarations ... Read More

Importance of MethodHandles class in Java 9?

raja

raja

Updated on 31-Mar-2020 15:48:15

166 Views

MethodHandles class introduced in Java 7 version. This class primarily added some static methods to better the functionality, and falls into several categories like Lookup methods that help to create method handles for methods and fields, Combinator methods that combine or transform pre-existing method handles into new ones, and factory methods to create method ... Read More

How to print all attributes in StackFrame API in Java 9?

raja

raja

Updated on 31-Mar-2020 12:41:29

130 Views

StackWalker API is a new feature in Java 9, and it improves the performance of the predecessor stack track element. It can also provide a way to filter the stack elements in case of exception or to understand application behavior. In Java 9, the way to access the stack trace is very limited ... Read More

Importance of Thread.onSpinWait() method in Java 9?

raja

raja

Updated on 31-Mar-2020 11:24:07

689 Views

Thread.onSpinWait() method has been introduced in Java 9. It is a static method of Thread class and can be optionally called in busy-waiting loops. It allows the JVM to issue processor instructions on some system architectures to improve reaction time in such spin-wait loops, and also reduce the power consumed ... Read More

How to list all the classes, interfaces, and enums in JShell in Java 9?

raja

raja

Updated on 31-Mar-2020 08:47:01

311 Views

The JShell tool also called REPL(Read-Evaluate-Print-Loop) introduced in Java 9 that allows us to execute Java code and getting immediate results. We can quickly evaluate expressions or short algorithms without creating a new project, compile or build it. With the help of JShell, we can execute expressions, use imports, define ... Read More

When can we use StackWalker.getCallerClass() method in Java 9?

raja

raja

Updated on 30-Mar-2020 15:26:41

218 Views

Java 9 has provided an efficient way of stack walking for lazy access, filtering stack trace using StackWalker API. An object of StackWalker can allow us to traverse and access to stacks. This class contains some useful methods like walk(), forEach(), and getCallerClass().The getCallerClass() method returns the class that invokes ... Read More

Differences between Compact Strings and Compressed Strings in Java 9?

raja

raja

Updated on 30-Mar-2020 11:50:08

156 Views

Compact Strings have introduced in Java 9 to replace Java 6's Compressed Strings. Its implementation uses byte[] array instead of char[] array and a new field coder has introduced to identify whether it is LATIN1 or UTF16 format while Compressed Strings have introduced in Java 6 that can be used byte[] array for one byte per character, ... Read More

Advertisements