Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

What is the difference between java compile time inheritance and run time inheritance?

user-image
Question added by harikisan rajbangshi haridhan rajbangshi
Date Posted: 2013/10/03
Venkat ramanarsaiah Bathem
by Venkat ramanarsaiah Bathem , Programmer Analyst , cognizant

The term "inheritance" refers to a situation in which attributes and/or behaviors are passed on from one object to another. When this occurs at compile-time, it is usually called "subclassing" since one class, the child, is lower than the parent in the inheritance hierarchy. The Java programming language reserves the keyword "extends" for compile-time inheritance.

Runtime inheritance refers to the ability to construct the parent/child hierarchy tree at runtime. While Java does not allow this natively, there are a number of projects and technologies available that will enable you to modify the bytecode of a class after compilation. While they really aren't intended to use for runtime inheritance, they could do the job.

More Questions Like This