Monday 5 December 2011

run-time polymorphism in java .

if you are dealing with polymorphism in java than definitely at the start you will face the problem in the phase of run-time polymorphism . so do you ever think that what type of thing is happened at the time of run-time polymorphism . for this look at this picture ::--

in this figure i have just described the program , because we all deal with this type of programming in the phase of run time polymorphism , now think about the output of this program .


now think about this ... how this process is happening from the scratch or from the compile time , now see at this picture , this image is passed or this is the run_time_constant_pool which is passed after the compilation of the program .
so this text of information is passed at the time of run time see at the point 4 ... from point 3 ...
you can see that compiler told to jvm that there are two methods which are referencing from main-class(1) and support-class(2) . so at the compiler time methods are only checked that they are legal or illegal . and they are displayed or represented as legal .

now at the run time , we are taking run time because objects are created at run time and every linking is performed at run time .















No comments: