1. Challenge the convention: Actual Date is dependent on the underlying JVM
2. Challenge the convention: Oracle JDBC driver 9.2.0.1 bug
Featured Post
The great debacle of healthcare.gov
This is the first time in history when the president of the United States of America, or probably for any head of state around the world,...
Tuesday, February 26, 2008
Monday, February 4, 2008
In Java: That I used to get confused
Inheritance
Overriding Access Modifier:
In overriding, the access modifier can allow more. i.e. If the access modifier is declared as protected in the parent, the child can only change it to public.
Hiding member method:
In case of class methods, if the child class declares the same class method with the same signature (that is the combination of method name, parameter number) then it is considered as the child hides the parent's method. In that scenario, the method actually invoked depends on from where the class method is being called.
Cat cat = new Cat();
Animal animal = cat;
The Animal.classMethod() will invoke the Parent's (Animal) and the Cat.classMethod() will invoke the Child's (Cat) implementation.
This is somewhat opposite in case of instance method overriding; the method gets invoked depends on the instance of the class.
Hiding member variable:
If the child uses any member variable of the name same as in parent class, even if the types are different, the field variable is considered to be hidden by the child. In this case super keyword needs to be used to access the parent 's member variable. This is known as field hiding.
Overriding Access Modifier:
In overriding, the access modifier can allow more. i.e. If the access modifier is declared as protected in the parent, the child can only change it to public.
Hiding member method:
In case of class methods, if the child class declares the same class method with the same signature (that is the combination of method name, parameter number) then it is considered as the child hides the parent's method. In that scenario, the method actually invoked depends on from where the class method is being called.
Cat cat = new Cat();
Animal animal = cat;
The Animal.classMethod() will invoke the Parent's (Animal) and the Cat.classMethod() will invoke the Child's (Cat) implementation.
This is somewhat opposite in case of instance method overriding; the method gets invoked depends on the instance of the class.
Hiding member variable:
If the child uses any member variable of the name same as in parent class, even if the types are different, the field variable is considered to be hidden by the child. In this case super keyword needs to be used to access the parent 's member variable. This is known as field hiding.
Wednesday, December 26, 2007
Add command prompt option to the windows explorer context menu
For Windows XP:
In Explorer, open Tools, Folder Options.
- Select the File Types tab.
- Go to NONE / Folder.
- Press Advanced button.
- In the action block type “Command Prompt” without the quotes.
- In the app block type “cmd.exe” without the quotes.
- Save and exit Folder Options.
I used this in my university time but later on I forgot how to activate that. I found an article in the web and put it in my blog so that I don't have to struggle again to recall it.
In Explorer, open Tools, Folder Options.
- Select the File Types tab.
- Go to NONE / Folder.
- Press Advanced button.
- In the action block type “Command Prompt” without the quotes.
- In the app block type “cmd.exe” without the quotes.
- Save and exit Folder Options.
I used this in my university time but later on I forgot how to activate that. I found an article in the web and put it in my blog so that I don't have to struggle again to recall it.
Subscribe to:
Posts (Atom)