Core Java interview questions and Answers

Last updated on Feb 06, 2023
  • Share
Core Java interview questions

Core Java, or Java Standard Edition (SE) is a computing platform for building standalone applications or system software. Using Java programming language, Core Java is a part of the Java software family. In Core Java, you will understand the basic Java programming concepts that are used in all classes from Java EE to desktop applications. Java SE also defines general-purpose APIs and includes Java Language Specification and Java Virtual Machine Specification. Oracle Corporation's Java Development Kit (JDK) is one of the most popular implementations of Java SE. You can now read our vast collection of latest core java interview questions.

Most Frequently Asked Core Java interview questions

Here in this article, we will be listing frequently asked Core Java interview questions and Answers with the belief that they will be helpful for you to gain higher marks. Also, to let you know that this article has been written under the guidance of industry professionals and covered all the current competencies.

Q1. List some OOPS Concepts in Java?

In Java, there are 10 OOPS concepts as follows:

  • Abstraction
  • Encapsulation
  • Inheritance
  • Polymorphism
  • Association
  • Composition
  • Aggregation
  • Delegation
  • Coupling
  • Cohesion
Q2. List some important features of Java 10 release?

Here are some of the most important Java 10 features:

  • Local-Variable Type Inference
  • Consolidate the JDK Forest into a Single Repository
  • Garbage-Collector Interface
  • Parallel Full GC for G1
  • Application Class-Data Sharing
  • Thread-Local Handshakes
  • Heap Allocation on Alternative Memory Devices
  • Experimental Java-Based JIT Compiler
  • Root Certificates
  • Time-Based Release Versioning
Q3. What is JVM?

A part of Java Run Environment (JRE), JVM is a virtual machine that provides runtime environment to drive Java programs or applications. It assists in converting bytecode into machine language and handles system memory.

Q4. Explain the difference between JDK and JVM?
1. Stands for Java Development Kit Stands for Java Virtual machine
2. Provides environment for developing and running Java programs. Interprets byte code into the machine code
3. Includes development Tools Allows platform-independent coding
Q5. Explain the difference between JVM and JRE?
1. Provides runtime environment for Java apps and programs Stands for Java Runtime Environment
2. An integral part of JDK and JRE Provides an environment to run java programs only
3. Responsible for executing a java program Part of JRE distribution
Q6. Why does Java does not support multiple inheritance? Explain

Java does not support multiple inheritances because it may lead to overriding of methods when extended classes have the same method names.

Also, supporting multiple inheritances through classes may give rise to ambiguity errors. However, multiple inheritance is possible through the interface.

Q7. Why Java is called not pure Object Oriented language?

Java is not a pure OOP language as it uses primitive datatypes such as int float char double. A pure OOP language should use nothing but objects, and everything should be a class. But in Java, not everything is a class, such as byte, int, float, char, etc. This is the reason Java is a not a pure OOP language.

Q8. What is difference between classpath and path variables in Java?
  Classpath Path
1. Used to find path of classes Used to find executables
2. Refers to environment Refers to system
Q9. What is the purpose of main function in Java?

From version JDK6 onwards, the main method is mandatory to start code execution. If your program does not contain "main" method, you will get a run-time error. Please note that in the absence of "main" method your entire program will successfully compile but it will throw an error at runtime.

Q10. Explain access modifiers in Java.

Access modifiers help to restrict the scope of a class, variable, constructor, method or data.

Four types of access modifiers are available:

  • Default
  • Private
  • Protected
  • Public

Development History

J2SE 1.2 was released in December 1998. Subsequent releases of J2SE were done over the years. It was after J2SE 5, in December 2006, Sun replaced "J2SE" with "Java SE" and removed ".0" from the version numbers.

Latest Version

Oracle released Java SE 11.0.1 in Oct 2018, which is the latest release for Java SE 11 Platforms. Get more knowledge on this if you are preparing for core java interview questions and answers.

Our updated core java interview questions for 6 years experience professionals are one of the biggest question bank available online.

Reviewed and verified by Best Interview Question
Best Interview Question

With our 10+ experience in PHP, MySQL, React, Python & more our technical consulting firm has received the privilege of working with top projects, 100 and still counting. Our team of 25+ is skilled in...