Sunday 24 July 2011

difference b/w two same things ( super / this )

when we override something or extend something , what is the cause  ,that you can access any method . from from both super and sub classes .

the thing is that when you create a object at that time a default constructor is called , and calls itself implicitly , and you can also define it . but the game is that what happen in implicitly . in implicitly , the
super perform a task that , it tells the compiler that super class have these these things and now you are also the owner of these things .

but now what is the difference between , this and super , generally ' this ' is the keyword which is used for ,
reference , means totally opposite from super , but these two things provide same things to you but in different way , and you can not add these two things in a constructor . at a same time .

this is related with object ' reference ' ;
===============================================

No comments: