Raja has Published 760 Articles

What are automatic modules in Java 9?

raja

raja

Updated on 07-Apr-2020 12:22:23

299 Views

An automatic module is a jar that we put on the modulepath. There is a number of pre-existing libraries that can be used in our applications, and many of these are not yet modularized. To facilitate migration, we can add any library’s jar file to an application’s module path, then use ... Read More

How to reset the JShell session in Java 9?

raja

raja

Updated on 07-Apr-2020 09:22:26

430 Views

Java 9 has introduced JShell for Java, and it allows us to evaluate code snippets such as declarations, statements, and expressions.During the JShell session, we need to reset it without closing and re-opening JShell then we can use the internal command: "/reset". By using this command, code entered during the current session has ... Read More

What are the different feedback modes in JShell in Java 9?

raja

raja

Updated on 06-Apr-2020 14:22:14

157 Views

When performing an operation in the JShell tool, it displays a message in return (success of the command, error, and type of a variable created as well as its value). It has been customized using the command: "/set feedback". This command displays the type of return currently configured as well as the ... Read More

What is the structure of JDK and JRE directory in Java 9?

raja

raja

Updated on 06-Apr-2020 12:26:15

2K+ Views

The directory structure of JDK and JRE are almost the same, except that JDK has two additional directories like jmods and include and also there is no JRE subdirectory in the JDK9 version. The JDK directory is the root directory for JDK software installation. This directory also includes copyright, readme, and src.zip files, which can be a ... Read More

How to set a verbose mode in JShell in Java 9?

raja

raja

Updated on 06-Apr-2020 09:04:52

303 Views

JShell is the REPL tool that has introduced in Java 9. We can use this tool to execute simple snippets in the command-line prompt.When we enter an arithmetic expression, variable, etc in JShell, then it displays the result without details of the type of variable created. It is possible in JShell to ... Read More

How to print previously typed snippets in JShell in Java 9?

raja

raja

Updated on 03-Apr-2020 17:07:48

61 Views

JShell is an official Read-Evaluate-Print-Loop (REPL) introduced in Java 9. It provides an interactive shell for quickly prototyping, debugging, and learning Java and Java API without the need for a main() method.The "/list" command in JShell prints out all of the previously typed snippets of that particular session with a ... Read More

What are the changes in Memory Management in Java 9?

raja

raja

Updated on 03-Apr-2020 14:09:51

220 Views

Garbage Collection or simply GC is the core part of Memory Management in Java. It can be responsible for cleaning dead objects from memory and reclaiming that space. GC executes cleanup using predefined Garbage Collectors that uses certain algorithms.There are a few important types of Garbage Collectors listed belowSerial GC: A single thread collector and applies ... Read More

How can we import a gson library in JShell in Java 9?

raja

raja

Updated on 02-Apr-2020 16:46:03

251 Views

Java 9 introduced an interactive REPL command-line tool named JShell. It allows us to execute Java code snippets and get immediate results. We can import external classes that can be accessed from a JShell session through the classpath. The Gson library is a Java serialization/deserialization library intended for converting Java Objects ... Read More

What are the different status states of REPL in Java 9?

raja

raja

Updated on 02-Apr-2020 12:50:55

176 Views

REPL stands for Read-Evaluate-Print-Loop. It holds some states, and each statement in JShell has a state. This state denies the execution status of snippets and variables. It can be determined by the results of the eval() method of JShell instance, which evaluates the code.There are seven different status states listed below.DROPPED: The ... Read More

How to implement the encapsulation concept in JShell in Java 9?

raja

raja

Updated on 02-Apr-2020 09:44:51

72 Views

Java Shell (simply JShell) is a REPL interactive tool for learning the Java and prototyping Java code. It evaluates declarations, statements, and expressions as entered and immediately prints out the result and runs from the command-line.Encapsulation is an important concept in Java to make sure that "sensitive" data has been hidden from users. ... Read More

Advertisements