Friday, February 19, 2010

encounters of a new java learner

hi here im trying to de'scribe my encounters with java.. tricky ones...

  • class- has access of default or public only...(this i didnot know and i worked for 10 months on java :0 was dumbstrcuk after reading it)

  • if the inheritance flow is through packages..if at any stage a method becomes invisble to one class then its sub classes will also never see it..even though they would have if u remove the class in between which was not able to see.
  • but for abstract class heirarchy through packages an abstract method (default acess) may not be visible in one class but it is visible in the subclasses in the visbility packages group.

  • if u r using super class as a polymorphic reference to access a method..criterions that need to be justified are -
  1. the method should also be there in super class
  2. actual objects method would be called at run time if there exists a correctly overridden method or a method which is equal as overriding method but not an override officially since the overridden method is not visible else
  3. the method of the superclass reference runs
  • always while accessing a method or instance variable through . reference check
  1. if you can access the class from the class where u r trying to
  2. if you can access the method from the class where u r trying to