Interface Java Interview Questions – Set 08

What is an observer design pattern The Observer pattern is a behavioral design pattern that  allows an object (an Observer) to watch another object (a Subject). The subject and observer to have a publish/subscribe relationship. Observers can register to receive events from the Subject. Some of the practical uses of observer pattern are: When a … Read more

Interface Java Interview Questions – Set 07

What is a Session? Can you share a session object between different threads Session is a light weight and a non-threadsafe object (No, you cannot share it between threads) that represents a single unit-of-work with the database. Sessions are opened by a SessionFactory and then are closed when all work is complete. Session is the … Read more

Interface Java Interview Questions – Set 06

When can an object reference be cast to an interface reference An object reference be cast to an interface reference when the object implements the referenced interface. What is a cloneable interface and how many methods does it contain ?– It is not having any method because it is a TAGGED or MARKER interface. What … Read more

Interface Java Interview Questions – Set 05

When does the compiler insist that the class must be abstract If one or more methods of the class are abstract. If class inherits one or more abstract methods from the parent abstract class and no implementation is provided for that method If class implements an interface and provides no implementation for those methods How … Read more

Interface Java Interview Questions – Set 04

What is the difference between the JDK 1.02 event model and the event-delegation model introduced with JDK 1.1? The JDK 1.02 event model uses an event inheritance or bubbling approach. In this model, components are required to handle their own events. If they do not handle a particular event, the event is inherited by (or … Read more