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 process of converting an object into byte sequence that can be persisted to a disk or can be sent through streams is called Serialization.
The reverse process of Serialization, i.e. creating objects from a sequence of bytes is called deserialization.
Java is pass by value because variables are references and their value is passed to the methods.
This question was asked in a lot of latest core java interview questions.
When the break statement is inside a loop, the loop gets terminated and the program resumes at the next statement after the loop.
The continue statement can be used in the loop control structure. It causes the loop to jump to the next iteration.
It is the only conditional operator that can take three operands and assists in evaluating Boolean expressions. It is a replacement for if-then-else statement and is used a lot to replace the switch. Its goal s to decide what value should the variable be assigned.
It is the design technique for implementing has-a relationship in a class. You can use java inheritance or Object composition for reusing the code. You can achieve Java composition by using instance variables that are referring to other objects.
Encapsulation is one of the four OOP concepts. It is a way of wrapping variables and code on data as a single unit. The class variables are hidden from other classes, and can be accessed only through their current class. Therefore, this method is also called data hiding.
S.no | String | StringBuffer | StringBuilder |
---|---|---|---|
1. | Immutable | Mutable | Mutable |
2. | For logic operations, it is slow | Thread-safe | Faster and more efficient |
3. | Use it when immutable structure is required. | Use it for creating mutable character sequence but string changes must be synchronized | Use it for creating mutable character sequence |
Java Access Specifiers regulate access to field, class, and method. Also called as visibility specifiers, they determine if a method or field can be used by another method in some other class. An important part of OOP, they are also used to restrict access.
There are four types of Access Specifiers:
- Public
- Private
- Protected
- Default
In an ordered collection, the elements have a specific order, which is independent of the value. For example a List.
In the sorted collection, the collection has an order, and the order depends on the value of the element. For example a SortedSet.
Developers should know everything about core java programs before their next interview.
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.