Raja has Published 760 Articles

How JShell tool works internally in Java 9?

raja

raja

Updated on 10-Apr-2020 08:52:04

234 Views

JShell tool has introduced in Java 9 that provides a fast and friendly environment that enables us to quickly explore, discover, and experiment with Java language features and extensive libraries.When the code entered into the JShell console, it is processed by JLine. It is a Java library that allows us to ... Read More

What is the importance of jmod format in Java 9?

raja

raja

Updated on 09-Apr-2020 18:15:29

683 Views

Java 9 has introduced a new format called "jmod" to encapsulate modules. The jmod files can be designed to handle more content types than jar files. It can also package local codes, configuration files, local commands, and other types of data. The "jmod" format hasn't support at runtime and can be based ... Read More

What are the different "/types" commands in JShell in Java 9?

raja

raja

Updated on 09-Apr-2020 14:57:27

372 Views

JShell tool has introduced in Java 9 version. It is also called a REPL(Read-Evaluate-Print-Loop) tool that allows us to execute Java code and getting immediate results. We need to list out the declared types like class, interface, enum, and etc by using the "/types" command.Below are the different "/types" commands in JShell./types ... Read More

When to use the ServiceLoader class in a module in Java 9?

raja

raja

Updated on 09-Apr-2020 12:22:21

203 Views

Java has a ServiceLoader class from java.util package that can help to locate service providers at the runtime by searching in the classpath. For service providers defined in modules, we can look at the sample application to declare modules with service and how it works.For instance, we have a "test.app" module that ... Read More

How to display different list commands in JShell in Java 9?

raja

raja

Updated on 09-Apr-2020 09:28:48

290 Views

JShell has introduced in Java 9 and is a command-line tool that allows us to enter simple statements, expressions, methods, and classes without a main () method.When we can enter code in JShell, the code has assigned a unique ID. This ID starts at 1 and has incremented for each command ... Read More

How to save the current JShell session in Java 9?

raja

raja

Updated on 08-Apr-2020 16:05:07

525 Views

Java 9 has introduced a new feature is the creation of a REPL (Read-Evaluate-Print-Loop) called JShell. It is a command-line prompt tool to evaluate Java code without the need to write a complete program.When we can enter code or internal commands in JShell, we need to use it during the current ... Read More

What is an unnamed module in Java 9?

raja

raja

Updated on 08-Apr-2020 11:52:20

769 Views

An unnamed module is a concept of the unnamed package. It is a module in which packages or classes can't be defined in any named module but exist in the jar file from classpath. If our code can try to load type from those files, the module system attempts to lookup classpath and loads it.An unnamed module read all ... Read More

How to traverse a process tree of Process API in Java 9?

raja

raja

Updated on 08-Apr-2020 09:18:08

243 Views

Java 9 has improved Process API, and it helps to manage and control operating system processes. Before Java 9, it has been difficult to manage and control operating system processes using Java programs. Since Java 9, new classes and interfaces have added to control the operating system process through Java ... Read More

How can we get an ID of the running process in Java 9?

raja

raja

Updated on 07-Apr-2020 18:29:21

598 Views

Java 9 has added improvements to Process API for getting PID of running process, getting children and/or descendants of a process, and also added a new class that helps to list out all running processes, getting information about an arbitrary process, and traversing process tree. The information returned by these methods can be a ... Read More

How can we load a source code into JShell in Java 9?

raja

raja

Updated on 07-Apr-2020 14:33:07

215 Views

JShell is an interactive tool for learning Java, and it is a REPL(Read-Evaluate-Print-Loop) that evaluates declarations, statements, and expressions.While leaving a JShell session, we want to reuse the code previously entered into a new session. This can be done by using the command: /open [File_Path]. This command will load all ... Read More

Advertisements