Home » #javaInterviewQuestions

#javaInterviewQuestions

Factory Method Pattern

The Factory Method is a design pattern that provides a way to create objects without specifying their exact classes. It lets you delegate the responsibility of creating objects to subclasses, allowing for flexible and adaptable object creation. Imagine you’re developing an application for managing a furniture business. In the initial version of your app, it’s […]

Factory Method Pattern Read More »

Java Design Patterns

Design patterns are like handy guides for solving common problems in how we create software. They’re a bit like ready-to-use templates that can be adjusted to fit the specific issues we face in our code.Remember, you can’t just grab a pattern and insert it exactly into your program, like using pre-made tools. A pattern isn’t

Java Design Patterns Read More »

Observer design pattern

In Java, the Observer pattern establishes a one-to-many dependency relationship among objects. As name suggest, we have 2 object: observer (there can be multiple observer) and observable. When an observable object changes its state, all registered observers are notified and updated automatically. This design promotes loose coupling, contributing to code maintainability and flexibility. Benefits The

Observer design pattern Read More »

Core Java

41. What is Static block in java?Static block in Java is mainly used to initialize the static data members. The specialty of the static block is that it is executed before the main method at the time of class loading.An example of the static block is as follows: 42. Can we execute a program without

Core Java Read More »

Scroll to Top