Prev Next

Java / Java 11

1. What is the Java Flight Recorder tool introduced in Java 11?

Java Flight Recorder (JFR) is a Java profiling tool that monitors and diagnoses any running Java application. It is responsible for collecting data about the running environment, JVM, and Java application and dumps the recorded data into a .jfr file, and which we can consume using Java Mission Co...

Read full answer

2. What is Java Mission Control in Java 11?

Java Mission Control is an application that can analyze the dumps that come from Java Flight Recorder, and give you a graphical overview of what is happening inside of a JVM.

Read full answer

3. List some of the Java 11 Features.

Java 11 is the first long-term support (LTS) release after Java 8. Oracle also stopped supporting Java 8 in January 2019. So it becomes mandatory for the application teams to onboard to Java 11 ASAP. some of the new features include, new methods/API to the String class: isBlank, lines, strip, str...

Read full answer

4. What is the Z Garbage Collector (ZGC) in Java 11?

The Z Garbage Collector (ZGC) is a scalable low latency garbage collector. ZGC performs all expensive work concurrently, without stopping the execution of application threads for more than 10ms, which makes it suitable for applications that require low latency and/or use a very large heap (multi-...

Read full answer

5. Difference between Oracle JDK and OpenJDK.

The main difference between Oracle JDK and OpenJDK is that Oracle JDK incorporates some commercial features. Rather than removing these features to get conversions between Oracle JDK and OpenJDK, Oracle has committed to open source these commercial features into OpenJDK. Until Java 10, you could ...

Read full answer

6. Mention few deprecated modules in Java 11.

Nashorn JavaScript Engine, Pack200 compression scheme for JAR files.

Read full answer

7. What is Nest-Based Access Control feature in Java 11?

Nest-Based Access Control, supports private member access within nest members directly, without the need of any auto-generated bridge method. The change is backward compatible, which requires no code change, it is just a Java compiler's optimization to remove the bridge method access internally.

Read full answer

8. What is String.lines() API in Java 11?

The lines() method is a static method that returns a stream of lines extracted from a given multi-line string, separated by line terminators. public Stream lines() The stream returned by lines() method contains the lines from this string in the same order in which they occur in the multi-...

Read full answer

9. Explain String strip API in Java 11.

String class includes 3 more methods which help in removing extra white-spaces in Java 11. String strip() returns a string whose value is given string, with all leading and trailing white space removed. This API is similar to String.trim() method. String stripLeading() returns a string whose valu...

Read full answer

10. What are compact Strings in Java?

Since Java 9, the JVM optimizes strings by using a new feature called Compact Strings. Instead of having a char[] array, a string can be represented as a byte[] array. We can use either UTF-16 or Latin-1 to produce either one or two bytes per character. If JVM detects the string contains only ISO...

Read full answer

«
»

Comments & Discussions