Core Java Interview Questions and Answers for experienced


Name some important features of Java 12 release?
Java 12 was launched on March 19, 2019. It is a Non-LTS version. Some of the Java 12 Features are:
JVM Changes – JEP 189, JEP 346, JEP 344, and JEP 230.
Switch Expressions
File mismatch() Method
Compact Number Formatting
Teeing Collectors in Stream API
New Methods in String Class
JEP 334: JVM Constants API
JEP 305: Pattern Matching for instanceof
Raw String Literals is Removed From JDK 12.
What are the important features of Java 11 release?
Java 11 is the second LTS release after Java 8. They’ve changed the licensing and support model which means if you download the Java 11 Oracle JDK, it will be paid for commercial use. If you want to use free version, you can download it from OpenJDK website.
Some of the important features of Java 11 are:
We can run a java program directly through java command. The source file will be implicitly compiled and executed. It’s part of JEP 330 feature implementation.
There are 6 new methods added in String class – isBlank(), lines(), strip(), stripLeading(), stripTrailing(), and repeat(). You can read all about them at our article on Java String class.
Files class got two new methods to read/write string data – readString() and writeString().
We can use “var” with lambda expressions too. It’s part of JEP 323 implementation.
Epsilon: A No-Op Garbage Collector for test environments. It’s an experimental feature and part of JEP 318.
Java EE and CORBA Modules have been removed from the standard JDK build. Nashorn JavaScript Engine has also been deprecated.
New HTTP Client (JEP 321) and Flight Recorder (JEP 328)
For a complete overview, please read Java 11 Features.
What are the important features of Java 10 release?
Java 10 is the first every-six-months from Oracle corporation, so it’s not a major release like earlier versions. However some of the important features of Java 10 are:
Local-Variable Type Inference
Enhance java.util.Locale and related APIs to implement additional Unicode extensions of BCP 47 language tags.
Enable the HotSpot VM to allocate the Java object heap on an alternative memory device, such as an NV-DIMM, specified by the user.
Provide a default set of root Certification Authority (CA) certificates in the JDK.
Java 10 is mostly a maintenance release, however I really liked the local variable type inference feature. For a detailed overview of Java 10, please go through Java 10 Features.
What are the important features of Java 9 release?
Java 9 was a major release and brought a lot of features. Some of the important features are:
Java 9 REPL (JShell)
Java 9 Module System
Factory Methods for Immutable List, Set, Map and Map.Entry
Private methods in Interfaces
Reactive Streams
GC (Garbage Collector) Improvements
You will find more details about them at Java 9 Features.
What are the important features of Java 8 release?
Java 8 has been released in March 2014, so it’s one of the hot topic in java interview questions. If you answer this question clearly, it will show that you like to keep yourself up-to-date with the latest technologies.
Java 8 has been one of the biggest releases after Java 5 annotations and generics. Some of the important features of Java 8 are:
Interface changes with default and static methods
Functional interfaces and Lambda Expressions
Java Stream API for collection classes
Java Date Time API
I strongly recommend to go through above links to get proper understanding of each one of them, also read Java 8 Features.
Name some OOPS Concepts in Java?
Java is based on Object Oriented Programming Concepts, following are some of the OOPS concepts implemented in java programming.
Abstraction
Encapsulation
Polymorphism
Inheritance
Association
Aggregation
Composition
Read more about them at OOPS Concepts in Java.
What do you mean by platform independence of Java?
Platform independence means that you can run the same Java Program in any Operating System. For example, you can write java program in Windows and run it in Mac OS.
What is JVM and is it platform independent?
Java Virtual Machine (JVM) is the heart of java programming language. JVM is responsible for converting byte code into machine readable code. JVM is not platform independent, thats why you have different JVM for different operating systems. We can customize JVM with Java Options, such as allocating minimum and maximum memory to JVM. It’s called virtual because it provides an interface that doesn’t depend on the underlying OS.
What is the difference between JDK and JVM?
Java Development Kit (JDK) is for development purpose and JVM is a part of it to execute the java programs.
JDK provides all the tools, executables and binaries required to compile, debug and execute a Java Program. The execution part is handled by JVM to provide machine independence.
What is the difference between JVM and JRE?
Java Runtime Environment (JRE) is the implementation of JVM. JRE consists of JVM and java binaries and other classes to execute any program successfully. JRE doesn’t contain any development tools like java compiler, debugger etc. If you want to execute any java program, you should have JRE installed.

Leave a Reply