Q1: Name some of significant changes in Java 9?
The
most important ones are: -
Module-A new type of Java programming component introduced as a module. This is a collection of named self-describing code and data.
REPL (JShell)-Added Read-Eval-Print Loop (REPL) function to Java platform.
HTTP2 Client-A new HTTP Client API that supports
WebSockets and HTTP2 stream and server push capabilities.
Improved JavaDocs-Supports the generation of HTML5 output. Provides a search box for the generated API documentation.
Multi-release JAR-Extends the JAR format so that multiple Java release-specific versions of class files can
coexist in a single archive.
a) Java
Platform Modular System
b) J Shell: Interactive JavaREPL
c) Private Interface Method
d) HTTP / 2
e) Improved Java Document
f) Multi-Release JAR
Q3: What are
the advantages of Java 9 module system?
a) More
Consistent Performance
b) Stronger Encapsulation
c) More Flexibility for Scaling
d) Better Performance
Q4: What is
REPL in Java 9?
The REPL is the Read-Evaluate-Print-Loop console that ships with Java 9. The REPL allows users to run arbitrary code snippets and evaluate the results.
Q5: What is
the stream improvement of Java 9?
Here are some improvements to Java 9 streams:
a) stream takeWhile /
dropWhile
b) stream iteration
c) nullable stream
Q6: What are
the improvements done for Try with Resources in Java 9?
The
try-resource block serves to automatically
close the resource after use.
The main drawback of this was that the resource had to be declared locally within that block.
Java 9 does not require local resource references to be declared.
Q7: What is
JShell in Java 9?
The
Java Shell Tool (JShell) is an interactive tool for learning
the Java programming language and prototyping Java code. JShell is a
Read-Evaluate-Print (REPL) loop that evaluates declarations, statements, and
expressions as you type and displays the results immediately. This tool is run from the command line.
Q8: What is
multi-release jar format in Java 9?
Multi-release
JARs allow users to create a single JAR that contains bytecode
for multiple versions of Java. The JVM then loads the code contained in that version.
👉Java Exception handling Interview Questions and Answers
👉Oops Interview Questions in Java for Freshers
👉Java Collection Framework Interview questions for Freshers
👉Java8 Interview Questions & Answers for beginners
0 Comments