Design Pattern: Factory Method Pattern

The Factory Method is a creational design pattern, in which an interface handles the creation of objects without specifying the class of an object that will be created. The subclasses will declare the type of object to be created. UML Diagram Example The Product interface is implemented by ProductA and ProductB. The Creator class holds …

Design Pattern: Observer

The observer pattern is a behavioral design pattern that allows an object (the observer) to notify other subscribed objects about any events that has occurred on the object they’re observing. When should I use this? When the change of a state in one object must be reflected in another object without keeping the objects tightly …

Design Pattern: Strategy

The Strategy design pattern is a behavioral pattern, where it defines a family of functionality, encapsulating each of them and making them interchangeable. This strategy pattern can be useful in a road navigator software, where you have an interface called routeStrategy and it has an abstract buildRoute() function. An all the possible route strategies like …

SQL Drop, Delete and Truncate

In SQL there are 3 commands that are used to remove data from a database. Although they remove data, they have major differences. Let’s assume we have a database call school and with in that school we have table call class, within this class we have a bunch of records of students that attend this …

Java Threads

Lets say we want our java program to run multiple tasks concurrently, how will we accomplish this ? Well, the answer is “threads“, threads run concurrently with other threads. In order to create threads we have to extend the “Thread” class or implement “Runnable” interface. Well what’s the difference? Remember that in java we can’t …

SQL Interview Questions

Q1: What is SQL? The Structure Query Language is the standard language for relational data bases. SQL uses tables to allow for setting or retrieving data from a database. Q2: Define DDL, DML and DCL DDL (Data Definition Language) – It allows you to perform sql commands that define the database scheme. Some of these commands …

Java Interview Questions

Q1: Is Java Platform dependent ? A: No, Java is a platform independent language. A platform independent language doesn’t depend on the operating system or hardware. Unlike programming languages like C++ or C which are platform dependent and won’t run on every platform. Q2: What makes Java a platform independent language? A: Java uses the …

Design a site like this with WordPress.com
Get started