Java 11 Interview Questions and Answers
Prepare for your Interview today!
Epsilon is the "No Op" garbage collector. It allocates new memory but never recycles it. Once the application exhausts the available Java heap, the JVM shuts down. It means, Epsilon will allow your application to run out of memory and crash. Elipson is good only for test environments and no-op garbage collector is useful for measuring and managing application performance.
Java 11 also added Z Garbage Collector(ZGC), which promises to manage large heaps with high throughput and short pause times. You need to specify below two runtime switches on the command line, to tell the JVM to use the Epsilon GC
XX:+UnlockExperimentalVMOptions
-XX:+UseEpsilonGC
Below command generate heap dump if JVM runs out of memory.
-XX:HeapDumpOnOutOfMemoryError
Run specified command when an out-of-memory error occurs.
-XX:OnOutOfMemoryError=
Java 11 removed the Java EE and CORBA modules from the Java SE Platform and the JDK, these modules were already deprecated in Java 9 with the declared intent to remove them in a future release.
It standardizes Http Client API, in the java.net.http package, based upon the incubated API, and removed the incubated API. The new API supports both HTTP/1.1 and HTTP/2. It is designed to enhance the overall performance of sending requests by a client and receiving responses from the server. It also natively supports WebSockets.
It allows var to be used when declaring the formal parameters of implicitly typed lambda expressions.
In Java 10, Local Variable Type Inference was introduced.
var str = "Java 10"; // infers Stringvar list = new ArrayList<String>(); // infers ArrayList<String>var stream = list.stream(); // infers Stream<String>svar bos = new ByteArrayOutputStream();
Java 11, allows var to be used to declare the formal parameters of an implicitly typed lambda expression.
(var a, var b) -> a + b
The examples below are illegal:
// Not allowed to mix 'var' and 'no var' in implicitly typed lambda expression(var a, b) -> a+b// Not allowed to mix 'var' and manifest types in explicitly typed lambda expression(var a, int b) -> a+b
Java makes further improvements in cryptography which provides security and performance. This feature implements a key agreement using Curve25519 and Curve448. Other cryptography libraries, such as OpenSSL and BoringSSL, already support key exchanges using Curve25519 and Curve448.
Most helpful rated by users: