Template Design Pattern

java-thumbnail

What is Template Design Pattern? An abstract class defines various methods and has one non-overridden method which calls the various methods. also read: Design Pattern Interview Questions Factory Design Pattern State design pattern Wikipedia Says: A template method defines the program skeleton of an aligorithm.The aligorithm itself is made abstract,and the subclasses override the abstract […]

Closures in Java 7.0

java-thumbnail

What is a closure? Wikipedia says: A closure is a function that is evaluated in an environment containing one or more bound variables.(Free variables which are to be passed to the function).In some languages closures may occur when a function is defined within another function and the inner function refers to the local variables of […]

Inner Classes in Java

java-thumbnail

As we all know what an inner class is so lets try to know few more rules about Inner Classes. Inner classes cannot have static members. only static final variables. also read: Java Tutorials Java EE Tutorials Design Patterns Tutorials Java File IO Tutorials Interfaces are never inner. Static classes are not inner classes. Inner […]

Abstract keyword In Java

java-thumbnail

What is Abstract As we all know,An abstract method declaration introduces the method as a member, providing its signature, return type, and throws clause , but does not provide an implementation. Every subclass of A that is not abstract must provide an implementation for method, or a compile-time error occurs. also read: Java Tutorials Java […]

ThreadLocal in Java

java-thumbnail

ThreadLocal is one of the rarely used class in Java. I found it is one of the powerful class in Java on multi-threaded programming. In multi threaded program generally we use session object to track the current users information. also read: Java Tutorials Java EE Tutorials Design Patterns Tutorials Java File IO Tutorials These information […]

Why multiple inheritance is not allowed in Java?

java-thumbnail

For long time I had a question “why Sun introduced Interface concept instead of C++ style of multiple inheritance?“. I did googling but many articles and forums talks about difference between abstract class and Interface not why Interface concept required in Java. After extensive search and analysis I came to know the reason behind the […]

Call Java Oracle Functions From Java program

java-thumbnail

Call Java Oracle Functions From Java program Beginning with version 8i, the Oracle database includes a fully functional Java Virtual Machine, Oracle JVM. Out of this close relationship between Oracle and Java emerges an important technology for Oracle developers: Java stored procedures. With Java stored procedures, developers have the ability to harness the power of […]

StringBuilder class in Java 5.0

java-thumbnail

java.lang.StringBuilder StringBuilder class is introduced in Java 5.0 version. This class is replacement for the existing StringBuffer class. If you look into the operations of the both the classes, there is no difference. also read: New Features in Java 5.0 Generics in Java 5.0 Annotations in Java 5.0 If you are using StringBuilder, no guarantee […]

Chain Of Responsibility Pattern In Java

java-thumbnail

Chain Of Responsibility Pattern Overview: A method called in one class will move up a class hierarchy until a method is found that can properly handle the call.It consists of a source of command objects and a series of processing objects.Each processing object contains a set of logic that describes the types of command objects […]

Comparing Objects in Java

java-thumbnail

Comparing Objects in Java In Java comparing two value object is not straight forward. Here we will see how we can compare two value objects in Java. For that first we will create a value object called “MyValueObject”. This value object contains two properties. firstName lastName. Both the properties are of type string. also read: […]