Monday, September 27, 2010
Monday, September 6, 2010
The Tao of Polymorphism
"In object-oriented programming (OOP), Inheritance is a way to compartmentalize and reuse code by creating collections of attributes and behaviors called objects which can be based on previously created objects." - Wikipedia
I dont know why everyone tend to use most difficult and hardest terms even for simple concepts. As for example above definition refers to Inheritance. We are not here to discuss Inheritance, but the advantages of Inheritance.
Labels:
Java,
Something More
Wednesday, September 1, 2010
BlogDay 2010
I am pretty sure that the above title is unfamiliar to you. Even I came to know about it today - actually a day late.
I can explain this but someone out there has done that in very simple manner.
Below paras are copy from the same.
So get your hands rubbing, Here are my recommendations,
OMG! Ubuntu!
The blog is purely dedicated to Ubuntu. So if you are into Ubuntu there is no blog better than this.
Strength: Total coverage. Nothing in Ubuntu-sphere is left out. Awesome language.
Weakness: Many posts a day. Time demanding
Lolland - The Indian Humour Site
Magnetic Infinity
The blog is about personal experiences of a student .. rather different and special one. What keeps me attached is the language used. It seems blog is dormant for quite sometime but hoping for author to keep up.
http://magneticinfinity.blogspot.com/
Vandit's Blog
Author is experienced computer engineering student and has shared his experiences.
http://www.iamvandit.co.cc/
ART of Friendship
Its the most active blog than above two. Blog is all about experiences of Electrical student.
http://koolrups-thosedays.blogspot.com/
SIDD Speaks
The most awesome blog I have ever seen. Author is well knowledgeable and knows how to explain with bit of humour. The blog is even most active blog.
http://www.sagarsiddhpura.blogspot.com/
Now thats called an ending.
I can explain this but someone out there has done that in very simple manner.
Below paras are copy from the same.
What is BlogDay?
BlogDay was created with the belief that bloggers should have one day dedicated to getting to know other bloggers from other countries and areas of interest. On that day Bloggers will recommend other blogs to their blog visitors.
With the goal in mind, on this day every blogger will post a recommendation of 5 new blogs. This way, all blog readers will find themselves leaping around and discovering new, previously unknown blogs.
With the goal in mind, on this day every blogger will post a recommendation of 5 new blogs. This way, all blog readers will find themselves leaping around and discovering new, previously unknown blogs.
What will happen on BlogDay?
one long moment on August 31st, bloggers from all over the world will post recommendations of 5 new Blogs, preferably Blogs that are different from their own culture, point of view and attitude. On this day, blog readers will find themselves leaping around and discovering new, unknown Blogs, celebrating the discovery of new people and new bloggers.
So get your hands rubbing, Here are my recommendations,
OMG! Ubuntu!
The blog is purely dedicated to Ubuntu. So if you are into Ubuntu there is no blog better than this.
Strength: Total coverage. Nothing in Ubuntu-sphere is left out. Awesome language.
Weakness: Many posts a day. Time demanding
Lolland - The Indian Humour Site
Its the most hilarious site i have seen. The author really has the skill of picking out Local anecdotes and deliver it in most amusive and refreshing way.
Amitbhavani's blog
The blog is an normal technical blog but FAQ's and How-To's posts out-stands this blog.
This blog is work of Harshal Pushkarna - Excellent professional writer. Author is also the writer for famous magazine "Safari". Blog is in gujarati language and very impressive.
As on this special post, I cannot end without my colleagues blogs.
The blog is about personal experiences of a student .. rather different and special one. What keeps me attached is the language used. It seems blog is dormant for quite sometime but hoping for author to keep up.
http://magneticinfinity.blogspot.com/
Vandit's Blog
Author is experienced computer engineering student and has shared his experiences.
http://www.iamvandit.co.cc/
ART of Friendship
Its the most active blog than above two. Blog is all about experiences of Electrical student.
http://koolrups-thosedays.blogspot.com/
SIDD Speaks
The most awesome blog I have ever seen. Author is well knowledgeable and knows how to explain with bit of humour. The blog is even most active blog.
http://www.sagarsiddhpura.blogspot.com/
Now thats called an ending.
Labels:
Something More
Saturday, August 28, 2010
Inheritance implementation in Java
"Understanding a concept does not mean merely remembering the definition, it includes knowing the working or application of that concept." - Come closer to the screen, look at above sentence and try to understand (its the definition of understand) it. I know its recursive but I will clarify it with the example of Inheritance:
Assume your instructor has chosen you for questioning, and he demands: "Explain Inheritance?". You somehow manage to utter some words "reuse", "code", "hierarchical relationship" and get the clean cheat. You get seated and wipe-off the perspiration.
If this scenario is common then you are a victim. You merely know the definition or have faint idea but do you know at what stage is inheritance comes in to the picture? Apart from by-hearting the definition, it is equally important to know how a concept is implemented. Lets have a look @ how Inheritance is implemented in Java. Beginning with process of compilation,
Assume class "Child" is child of class "Parent". We define both classes as follows:
class Parent class Child extends Parent
{ {
int a; int b;
} }
Now going by definition, we know that sub class inherits all the members of parent class, hence "Child" class should have two members conceptually:
int a;
int b;
And to verify it we create an object and try to access member a, and it works.
child ob = new Child();
ob.a = 10;
Weighing both sides,
This gap is filled at compilation level and Java handles Inheritance at compile time. Thus,
Compilation includes defining structure of each class. The moment javac senses one class to be child of another, it adds all members of super class to structure of child. Thus the class layout after compilation would be...
class Parent class Child
{ {
int a; int a;
} int b;
}
Getting This? YES or NO??? Ok, Repeating once more,
Inheritance (sub-class has all the members of super-class) is detected at compile time. If any class is found to be "child" of super-class, all members of super-class is added to structure of child-class. Finally all layouts is written to .class file and thus saved.
Now that's called Understanding Inheritance. I know you will let me know what have you inherited from this post via comments.
Assume your instructor has chosen you for questioning, and he demands: "Explain Inheritance?". You somehow manage to utter some words "reuse", "code", "hierarchical relationship" and get the clean cheat. You get seated and wipe-off the perspiration.
If this scenario is common then you are a victim. You merely know the definition or have faint idea but do you know at what stage is inheritance comes in to the picture? Apart from by-hearting the definition, it is equally important to know how a concept is implemented. Lets have a look @ how Inheritance is implemented in Java. Beginning with process of compilation,
Assume class "Child" is child of class "Parent". We define both classes as follows:
class Parent class Child extends Parent
{ {
int a; int b;
} }
Now going by definition, we know that sub class inherits all the members of parent class, hence "Child" class should have two members conceptually:
int a;
int b;
And to verify it we create an object and try to access member a, and it works.
child ob = new Child();
ob.a = 10;
Weighing both sides,
- At code level there is no member 'int b' in child class
- At execution level Child class has the member 'int b'.
This gap is filled at compilation level and Java handles Inheritance at compile time. Thus,
Compilation includes defining structure of each class. The moment javac senses one class to be child of another, it adds all members of super class to structure of child. Thus the class layout after compilation would be...
class Parent class Child
{ {
int a; int a;
} int b;
}
Getting This? YES or NO??? Ok, Repeating once more,
Inheritance (sub-class has all the members of super-class) is detected at compile time. If any class is found to be "child" of super-class, all members of super-class is added to structure of child-class. Finally all layouts is written to .class file and thus saved.
Now that's called Understanding Inheritance. I know you will let me know what have you inherited from this post via comments.
Labels:
Java,
Something More
Subscribe to:
Posts (Atom)
