Have a Question?

If you have any question you can ask below or enter what you are looking for!

Tag: Java interview question

Comparison table of SET Implemented classes?

Comparison table of SET Implemented classes?

Java Set is a collection of elements (Or objects) that contains no duplicate elements. Java Set is an interface that extends Collection interface. Unlike List, Java Set is NOT an ordered collection, it’s elements does NOT have a particular order. Java Set does NOT provide a control over the position where you . . . Read more

Why do we have to override the equals() method in Java?

Why do we have to override the equals() method in Java?

Why do we have to override the equals() method in Java? We can use the equals method to check equality of two objects. The equals() method of java.lang.Object class acts the same as the == operator; that is, it tests for object identity rather than object equality. The implicit contract of the equals() method, however, is . . . Read more

What is Daemon thread and How to make Daemon thread?

What is Daemon thread and How to make Daemon thread?

What is Daemon thread and How to make Daemon thread? The threads which are executing in the background are called Demon threads. Ex… Garbage Collector, Signal Dispatcher, Attach Listener. The main objective of demon threads is to provide support for non-demon threads(main thread) For ex… If the main thread runs . . . Read more

What is synchronization and why it is important?

What is synchronization and why is it important?

What is synchronization and why it is important? Synchronized is the modifier applicable only for methods and blocks but not for classes and variables. If multiple threads are trying to operate simultaneously on the same java object then there may be a chance of data-inconsistency problem. To overcome this problem we should go . . . Read more