Core Java interview questions and Answers
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
The static import feature allows the static member of a class to be accessed directly without using the qualified name. The biggest advantage of this feature is that less coding will be required if you have access to a static member.
It is a reference type that is similar to a class in Java. It is a collection of abstract methods that is used for full abstraction. An interface may have methods and variables but the methods in interface are abstract by default.
Abstract Class | Interface | |
---|---|---|
1. | Can have members, constants, defined methods and method stubs | Can only have methods stubs and constants |
2. | Methods and members can be defined with any visibility | Methods must be defined as public |
3. | May contain non-final variables. | Variables declared are by default final |
It is an interfaces that has no field or methods (empty interface). It helps in conveying to the JVM that the class that is implementing the interface of a category will have special behavior. It is also known as tag interface.
There are 4 major marker interfaces:
- Searilizable interface
- Cloneable interface
- Remote interface
- ThreadSafe interface
Annotation is a tag in Java that represents metadata attached with a class, method, interface, or field. It provides supplement information to be used by compiler and JVM. Annotations do not change a compiled program's action and they are not pure comments.
If you are preparing for interviews, you can check core java interview questions and answers for more insight.
It is a class that is a member of another class.
There are 4 types of inner classes:
- Nested Inner class
- Method Local inner classes
- Anonymous inner classes
- Static nested classes
Class loaders help in loading classes during runtime to the Java Virtual Machine. In addition, they are part of the Java Runtime Environment. Hence, due to class loaders, JVM is not required to know the underlying files for running programs.
There are 3 types of built-in Class Loaders:
- Bootstrap Class Loader: Loads internal classes
- Extensions Class Loader: Loads classes from extensions directory
- System Class Loader: Loads classes from the current classpath
Java will automatically create default constructors if there are no default constructors written by you.
The default constructor will call parent default constructor and initialize member data variable to default values.
It is the process through which Java programs perform memory management. When the Java programs run on JVM, objects get created in a part of the memory that is dedicated to program. When objects are no longer needed, the garbage collector finds and deletes them to free up program memory.
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.