Jun 18, 2008

enums in java

static can't be applied to method local classes but can be applied to inner classes.
------------------------------------------------------------------------------------

semicolon at the end of enums is optional
enums can be a class outside the non-inner public class or a memeber of some class but not that of a function

the enum values are constant

enums can have constructors. enums can have instance variables and enums can have functions

a single enum value can have content specific body which can give some particular behavious only for that enum constant. If the enum as whole also provides the same function, then that function is considered overriden for the enum value that has content specific body. semicolon is necessary for the content body of an enum value.

enum constructors are called automatically and can't be invoked in the code

Jun 17, 2008

interfaces in java are more of a contract

Interfaces can be used to co-relate classes which want to share a contract regarding something as those implementing the Serializable interface. But then inheritance also means contract as a MarutiCar extends Car. But the difference with interface is that the implementors of interface needn't have same hierarchy as in inheritance.

Say MarutiCar, GMCar and TataCar extend Car but only MarutiCar and GMCar implement the serializable interface and not TataCar. This means that MarutiCar and GMCar are in contract that they may be serialized but TataCar is not.

The difference is in usage of interfaces and not in overriding abstract methods.

Jun 13, 2008

published the article on JQuery

The second volume of Technical Journal in my organization is out and the much awaited (don't know by how many people :) ) article got published. It was a great feeling. Though the article doesn't discuss anything new than what exists in the JQuery at this time. But I really enjoyed writing the article by searching the best content I can collect from internet and provide much better information on the topic.

How by the way, JQuery is something easy JavaScript.