Raja has Published 760 Articles

How to implement the Fibonacci series in JShell in Java 9?

raja

raja

Updated on 17-Mar-2020 10:51:37

94 Views

JShell is a java shell tool introduced in Java 9 that allows us to execute Java code and prints the result immediately. It is a REPL (Read-Evaluate-Print-Loop) tool that runs from the command-line prompt. A number is said to be the Fibonacci series if each subsequent number is the sum of the ... Read More

What are new methods added to the String class in Java 9?

raja

raja

Updated on 17-Mar-2020 08:19:14

152 Views

A String is an immutable class in Java and there are two new methods added to the String class in Java 9. Those methods are chars() and codePoints(). Both of these two methods return the IntStream object.1) chars():The chars() method of String class can return a stream of int zero-extending ... Read More

How to get the parent process of the Process API in Java 9?

raja

raja

Updated on 16-Mar-2020 11:51:47

554 Views

ProcessHandle interface allows us to perform some actions, and check the state of a process. It provides the process’s native pid, start time, CPU time, user, parent process, and descendants. We can get access to a parent process by calling the parent() method, and the return value is Optional. It is empty if the child ... Read More

How to implement a lambda expression in JShell in Java 9?

raja

raja

Updated on 16-Mar-2020 09:31:21

232 Views

JShell is a Java's first REPL and command-line tool that provides interactive use of Java programming language elements. We can test the functionality in isolation of a class by using this tool. JShell creates a simple and easy programming environment in the command-line that takes input from the user, reads it, and prints ... Read More

What is Variable Handle in Java 9?

raja

raja

Updated on 13-Mar-2020 13:47:12

402 Views

Variable Handle is a variable or reference to a set of variables, including other components of a static field, non-static fields, and outer array elements in the heap data structure. It means that Variable Handle is similar to the existing Method Handle. It can be represented by using java.lang.invoke.VarHandle class. We can use ... Read More

How to load a file into the JShell session in Java 9?

raja

raja

Updated on 13-Mar-2020 11:54:32

1K+ Views

JShell is a new command-line interactive REPL (Read-Evaluate-Print-Loop) tool introduced in Java 9 to evaluate declarations, statements, and expressions written in Java. This tool also allows us to execute Java code snippets and get immediate results.Some times, we have the code already written in java file and able to execute it ... Read More

What is the importance of the ProcessHandle interface in Java 9?

raja

raja

Updated on 13-Mar-2020 11:27:01

428 Views

ProcessHandle interface introduced in Java 9. It allows us to perform actions and check the state of a process that relates. This interface provides the process’s native process ID (pid), start time, accumulated CPU time, arguments, command, user, parent process, and descendants.ProcessHandle interface allows us to perform the following actions.It returns a ... Read More

What is Http/2 Client in Java 9?

raja

raja

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

357 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

246 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

How to implement a String in JShell in Java 9?

raja

raja

Updated on 13-Mar-2020 05:26:34

247 Views

JShell is Java’s first official REPL application introduced in Java 9. It is a tool that helps in executing and evaluating simple java programs, and small logics such as statements,  simple programs, loops, expressions, etc. Java REPL can provide a simple programming environment in a command-line prompt. It reads the ... Read More

Advertisements