Monday, January 08, 2007
Saturday, January 06, 2007
Pettern - FACADE
Facade is a design Patern that provides an Interface to a System of Classes, hiding the implementation details of those classes behind a common Interface.
Thursday, January 04, 2007
Protected Vs Default Access Modifier
protected - allows classes in the same package and subclasses (in other packages) to still access the methods/variables
Default - allows only classes in the same package to access the methods/variables
Default - allows only classes in the same package to access the methods/variables
Static Block at Class level
There can be static blocks at the class level, which is will do what a constructor will do for a an instantied object. for example if the class has couple of static methods and the class needs to perform few setup tasks before the static methods are executed, since constructor will not be invoked in such cases where a static method is invoked, a static block at the class level (not inside a method) will do the job of a constructor for a static method of the class. NOTE - The Static block is invoked only once for a JVM, so if one static method of a class with static invoked, the static method will be invoked once in that JVM, and when other static methods of the same class invoked in the same JVM, the static block is not invoked again.
Subscribe to:
Posts (Atom)