Category: Core Java

List of Interview Questions on Java for freshers and experienced candidates asked in technical job interviews in IT Industries. This list includes interview questions asked to freshers, 2,3 and 5 years etc. experience professionals | Only Real.

This section contains technical java interview questions and answers for freshers and experienced on java Polymorphims, Java OOPs concept Inheritance, Interface, abstract class, abstraction and encapsulation, classes and objects etc. with impressive answers and explanation. In fact, interview question on many topics I have provided that you should read or brush up that help crack java technical java interviews quickly.

How to create immutable class in java – Simplest Example

Create immutable class in java by making class field final and private, providing getter setter method and returning new object with new data on object modification Technical interview question is that, make a user defined class immutable. Write a simple immutable class and Explain it. also, demonstrate that it is immutable in main program. Note…

Read the full article

What to choose between abstract class and interface if…

Answer to what to choose between abstract class and interface if both contains only abstract methods. This is the frequently asked technical interview question and two reasons are provided with examples. Elaborating the question for better understanding. You know that interface contains only abstract methods. But, consider the restriction that abstract class has only abstract…

Read the full article

What is method signature in Java – Does it include return type?

What is method signature in java ? – Method signature in java includes only method name and parameters. Method return types are not included in method signature. For example, in below class method declaration only “foo(String str)” is the method signature that contains method name and parameters. Return type String should in excluded.    …

Read the full article

What are methods of object class in java? – with description

Methods of Object class in java with brief descriptions – The java.lang.Object class is the super class of all classes  whether the class is predefined or user defined class. Object class is by default inherited whether we extend explicitly or not. Methods of object class in java : protected native Object clone() throws CloneNotSupportedException public boolean equals(Object…

Read the full article